Merge pull request #1236 from akortunov/guifixes

Minor GUI fixes
0.6.1
scrawl 8 years ago committed by GitHub
commit 97dbd07ed2

@ -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>()

@ -1064,18 +1064,22 @@ namespace MWMechanics
adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::RestoreHealth, magnitude); adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::RestoreHealth, magnitude);
break; break;
case ESM::MagicEffect::DamageHealth: case ESM::MagicEffect::DamageHealth:
receivedMagicDamage = true;
adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::DamageHealth, -magnitude);
break;
case ESM::MagicEffect::DamageMagicka: case ESM::MagicEffect::DamageMagicka:
case ESM::MagicEffect::DamageFatigue: case ESM::MagicEffect::DamageFatigue:
receivedMagicDamage = true;
adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::DamageHealth, -magnitude); adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::DamageHealth, -magnitude);
break; break;
case ESM::MagicEffect::AbsorbHealth: case ESM::MagicEffect::AbsorbHealth:
case ESM::MagicEffect::AbsorbMagicka:
case ESM::MagicEffect::AbsorbFatigue:
if (magnitude > 0.f) if (magnitude > 0.f)
receivedMagicDamage = true; receivedMagicDamage = true;
adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::AbsorbHealth, -magnitude); adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::AbsorbHealth, -magnitude);
break; break;
case ESM::MagicEffect::AbsorbMagicka:
case ESM::MagicEffect::AbsorbFatigue:
adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::AbsorbHealth, -magnitude);
break;
case ESM::MagicEffect::DisintegrateArmor: case ESM::MagicEffect::DisintegrateArmor:
{ {

Loading…
Cancel
Save