mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 03:29:55 +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:
commit
e2fc5d87b3
1 changed files with 4 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue