[Client] Reset statTimer every timeout

0.6.1
Koncord 8 years ago
parent 80631ae8bd
commit 9742b0a801

@ -187,6 +187,7 @@ void LocalPlayer::updateStatsDynamic(bool forceUpdate)
if (forceUpdate || (statTimer += MWBase::Environment::get().getFrameDuration()) >= timeoutSec)
{
statTimer = 0;
// Update stats when they become 0 or they have changed enough
bool shouldUpdateHealth = oldHealth != health && (health.getCurrent() == 0 || abs(oldHealth.getCurrent() - health.getCurrent()) > 3);
bool shouldUpdateMagicka = false;
@ -208,8 +209,6 @@ void LocalPlayer::updateStatsDynamic(bool forceUpdate)
magicka.writeState(creatureStats.mDynamic[1]);
fatigue.writeState(creatureStats.mDynamic[2]);
statTimer = 0;
getNetworking()->getPlayerPacket(ID_PLAYER_STATS_DYNAMIC)->setPlayer(this);
getNetworking()->getPlayerPacket(ID_PLAYER_STATS_DYNAMIC)->Send();
}

Loading…
Cancel
Save