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

Fixes mWatchedTimeToStartDrowning initialization (fixes bug #3801)

This commit is contained in:
Andrei Kortunov 2017-03-25 14:15:16 +04:00
parent e383e4d023
commit 7bd0c74aa8

View file

@ -232,8 +232,10 @@ namespace MWMechanics
invStore.autoEquip(ptr); invStore.autoEquip(ptr);
} }
// mWatchedTimeToStartDrowning = -1 for correct drowning state check,
// if stats.getTimeToStartDrowning() == 0 already on game start
MechanicsManager::MechanicsManager() MechanicsManager::MechanicsManager()
: mWatchedTimeToStartDrowning(0), mWatchedStatsEmpty (true), mUpdatePlayer (true), mClassSelected (false), : mWatchedTimeToStartDrowning(-1), mWatchedStatsEmpty (true), mUpdatePlayer (true), mClassSelected (false),
mRaceSelected (false), mAI(true) mRaceSelected (false), mAI(true)
{ {
//buildPlayer no longer here, needs to be done explicitly after all subsystems are up and running //buildPlayer no longer here, needs to be done explicitly after all subsystems are up and running
@ -324,9 +326,6 @@ namespace MWMechanics
winMgr->setValue(fbar, stats.getFatigue()); winMgr->setValue(fbar, stats.getFatigue());
} }
// FIXME: if game is just started and actor is already drowning (on savegame loading),
// drowning bar will be hidden, because
// getTimeToStartDrowning = mWatchedTimeToStartDrowning = 0.
if(stats.getTimeToStartDrowning() != mWatchedTimeToStartDrowning) if(stats.getTimeToStartDrowning() != mWatchedTimeToStartDrowning)
{ {
const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()