mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 20:49:41 +00:00
[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)
|
if (forceUpdate || (statTimer += MWBase::Environment::get().getFrameDuration()) >= timeoutSec)
|
||||||
{
|
{
|
||||||
|
statTimer = 0;
|
||||||
// Update stats when they become 0 or they have changed enough
|
// 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 shouldUpdateHealth = oldHealth != health && (health.getCurrent() == 0 || abs(oldHealth.getCurrent() - health.getCurrent()) > 3);
|
||||||
bool shouldUpdateMagicka = false;
|
bool shouldUpdateMagicka = false;
|
||||||
|
@ -208,8 +209,6 @@ void LocalPlayer::updateStatsDynamic(bool forceUpdate)
|
||||||
magicka.writeState(creatureStats.mDynamic[1]);
|
magicka.writeState(creatureStats.mDynamic[1]);
|
||||||
fatigue.writeState(creatureStats.mDynamic[2]);
|
fatigue.writeState(creatureStats.mDynamic[2]);
|
||||||
|
|
||||||
statTimer = 0;
|
|
||||||
|
|
||||||
getNetworking()->getPlayerPacket(ID_PLAYER_STATS_DYNAMIC)->setPlayer(this);
|
getNetworking()->getPlayerPacket(ID_PLAYER_STATS_DYNAMIC)->setPlayer(this);
|
||||||
getNetworking()->getPlayerPacket(ID_PLAYER_STATS_DYNAMIC)->Send();
|
getNetworking()->getPlayerPacket(ID_PLAYER_STATS_DYNAMIC)->Send();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue