1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 06:29:56 +00:00

Merge branch 'elemental_shields' into 'master'

Don't let elemental shields harm the player in god mode

Closes #5875

See merge request OpenMW/openmw!631
This commit is contained in:
Evil Eye 2021-03-02 06:45:38 +00:00
commit e2fc5d87b3

View file

@ -305,6 +305,10 @@ namespace MWMechanics
void applyElementalShields(const MWWorld::Ptr &attacker, const MWWorld::Ptr &victim)
{
// Don't let elemental shields harm the player in god mode.
bool godmode = attacker == getPlayer() && MWBase::Environment::get().getWorld()->getGodModeState();
if (godmode)
return;
for (int i=0; i<3; ++i)
{
float magnitude = victim.getClass().getCreatureStats(victim).getMagicEffects().get(ESM::MagicEffect::FireShield+i).getMagnitude();