From 023bc80f550bc936b936888d50cdf170f6736ebe Mon Sep 17 00:00:00 2001 From: Alexei Dobrohotov Date: Mon, 1 Mar 2021 21:37:30 +0000 Subject: [PATCH] Don't let elemental shields harm the player in god mode --- apps/openmw/mwmechanics/combat.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index 183845b8c1..7c625019d2 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -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();