1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 21:49:55 +00:00

Reduced scope of fHoldBreathTime variable

This commit is contained in:
Andrei Kortunov 2017-04-19 15:52:15 +04:00
parent c3fd327bb2
commit 3c4c47d1e6

View file

@ -328,13 +328,13 @@ namespace MWMechanics
winMgr->setValue(fbar, stats.getFatigue()); winMgr->setValue(fbar, stats.getFatigue());
} }
static const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fHoldBreathTime")->getFloat();
float timeToDrown = stats.getTimeToStartDrowning(); float timeToDrown = stats.getTimeToStartDrowning();
if(timeToDrown != mWatchedTimeToStartDrowning) if(timeToDrown != mWatchedTimeToStartDrowning)
{ {
static const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fHoldBreathTime")->getFloat();
mWatchedTimeToStartDrowning = timeToDrown; mWatchedTimeToStartDrowning = timeToDrown;
if(timeToDrown >= fHoldBreathTime || timeToDrown == -1.0) // -1.0 is a special value during initialization if(timeToDrown >= fHoldBreathTime || timeToDrown == -1.0) // -1.0 is a special value during initialization