mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:53:52 +00:00
Don't let elemental shields harm the player in god mode
This commit is contained in:
parent
fd602e2c31
commit
023bc80f55
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)
|
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)
|
for (int i=0; i<3; ++i)
|
||||||
{
|
{
|
||||||
float magnitude = victim.getClass().getCreatureStats(victim).getMagicEffects().get(ESM::MagicEffect::FireShield+i).getMagnitude();
|
float magnitude = victim.getClass().getCreatureStats(victim).getMagicEffects().get(ESM::MagicEffect::FireShield+i).getMagnitude();
|
||||||
|
|
Loading…
Reference in a new issue