forked from mirror/openmw-tes3mp
[Client] Reset statTimer every timeout
This commit is contained in:
parent
80631ae8bd
commit
9742b0a801
1 changed files with 1 additions and 2 deletions
|
@ -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…
Reference in a new issue