1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 23:53:52 +00:00

Don't search for fFatigueReturnBase and fFatigueReturnMult every frame

This commit is contained in:
scrawl 2014-09-27 15:19:15 +02:00
parent a5049fd7b0
commit ea956b537c

View file

@ -470,13 +470,13 @@ namespace MWMechanics
return; return;
MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats (ptr); MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats (ptr);
const MWWorld::Store<ESM::GameSetting>& settings = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
int endurance = stats.getAttribute (ESM::Attribute::Endurance).getModified (); int endurance = stats.getAttribute (ESM::Attribute::Endurance).getModified ();
// restore fatigue // restore fatigue
float fFatigueReturnBase = settings.find("fFatigueReturnBase")->getFloat (); const MWWorld::Store<ESM::GameSetting>& settings = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
float fFatigueReturnMult = settings.find("fFatigueReturnMult")->getFloat (); static float fFatigueReturnBase = settings.find("fFatigueReturnBase")->getFloat ();
static float fFatigueReturnMult = settings.find("fFatigueReturnMult")->getFloat ();
float x = fFatigueReturnBase + fFatigueReturnMult * endurance; float x = fFatigueReturnBase + fFatigueReturnMult * endurance;