stop weapon condition degredation (for the player) with tgm on

This commit is contained in:
mckibbenta 2013-10-02 13:46:33 -04:00
parent 99fe6e68c7
commit 073f64c8bb
2 changed files with 6 additions and 4 deletions

View file

@ -396,9 +396,10 @@ namespace MWClass
MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}");
MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f); MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f);
} }
weapon.getCellRef().mCharge -= std::min(std::max(1,
(int)(damage * gmst.find("fWeaponDamageMult")->getFloat())), if (!MWBase::Environment::get().getWorld()->getGodModeState())
weapon.getCellRef().mCharge); weapon.getCellRef().mCharge -= std::min(std::max(1,
(int)(damage * gmst.find("fWeaponDamageMult")->getFloat())), weapon.getCellRef().mCharge);
} }
healthdmg = true; healthdmg = true;
} }

View file

@ -276,7 +276,8 @@ namespace MWMechanics
} }
// If it's the player and God Mode is turned on, keep it alive // If it's the player and God Mode is turned on, keep it alive
if(iter->first.getRefData().getHandle()=="player" && MWBase::Environment::get().getWorld()->getGodModeState()) if(iter->first.getRefData().getHandle()=="player" &&
MWBase::Environment::get().getWorld()->getGodModeState())
{ {
MWMechanics::DynamicStat<float> stat(stats.getHealth()); MWMechanics::DynamicStat<float> stat(stats.getHealth());