Merge branch 'conspiracyofsilence' into 'master'
Some checks are pending
Build and test / Windows (2019) (push) Blocked by required conditions
Build and test / Windows (2022) (push) Blocked by required conditions
Build and test / Ubuntu (push) Waiting to run
Build and test / MacOS (push) Waiting to run
Build and test / Read .env file and expose it as output (push) Waiting to run

Make powers immune to silence (#8371)

Closes #8371

See merge request OpenMW/openmw!4557
This commit is contained in:
Alexei Kotov 2025-04-24 03:34:37 +03:00
commit 92edcb7a4a

View file

@ -274,15 +274,15 @@ namespace MWMechanics
CreatureStats& stats = actor.getClass().getCreatureStats(actor);
if (stats.getMagicEffects().getOrDefault(ESM::MagicEffect::Silence).getMagnitude() && !godmode)
return 0;
if (spell->mData.mType == ESM::Spell::ST_Power)
return stats.getSpells().canUsePower(spell) ? 100 : 0;
if (godmode)
return 100;
if (stats.getMagicEffects().getOrDefault(ESM::MagicEffect::Silence).getMagnitude())
return 0;
if (spell->mData.mType != ESM::Spell::ST_Spell)
return 100;