1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-21 21:09:40 +00:00

[Client] Send StatsDynamic packets more often

This commit is contained in:
David Cernat 2017-07-26 20:15:35 +03:00
parent bfbf1bbac4
commit 796118c266
3 changed files with 7 additions and 7 deletions

View file

@ -244,7 +244,7 @@ namespace MWMechanics
Include a messagebox notifying players that soul gems filled by players are not synced yet Include a messagebox notifying players that soul gems filled by players are not synced yet
*/ */
if (caster == getPlayer()) if (caster == getPlayer())
MWBase::Environment::get().getWindowManager()->messageBox("Soul gems filled by players are not synchronized in multiplayer yet and they will not show up for other players."); MWBase::Environment::get().getWindowManager()->messageBox("Soul gems filled by players are not synchronized in multiplayer yet and their souls will not show up for other players.");
/* /*
End of tes3mp addition End of tes3mp addition
*/ */

View file

@ -161,11 +161,11 @@ void LocalActor::updateStatsDynamic(bool forceUpdate)
auto needUpdate = [](MWMechanics::DynamicStat<float> &oldVal, MWMechanics::DynamicStat<float> &newVal, int limit) { auto needUpdate = [](MWMechanics::DynamicStat<float> &oldVal, MWMechanics::DynamicStat<float> &newVal, int limit) {
return oldVal != newVal && (newVal.getCurrent() == 0 || oldVal.getCurrent() == 0 return oldVal != newVal && (newVal.getCurrent() == 0 || oldVal.getCurrent() == 0
|| abs(oldVal.getCurrent() - newVal.getCurrent()) > limit); || abs(oldVal.getCurrent() - newVal.getCurrent()) >= limit);
}; };
if (forceUpdate || needUpdate(oldHealth, health, 5) || needUpdate(oldMagicka, magicka, 10) || if (forceUpdate || needUpdate(oldHealth, health, 3) || needUpdate(oldMagicka, magicka, 7) ||
needUpdate(oldFatigue, fatigue, 10)) needUpdate(oldFatigue, fatigue, 7))
{ {
oldHealth = health; oldHealth = health;
oldMagicka = magicka; oldMagicka = magicka;

View file

@ -202,11 +202,11 @@ void LocalPlayer::updateStatsDynamic(bool forceUpdate)
// Update stats when they become 0 or they have changed enough // Update stats when they become 0 or they have changed enough
auto needUpdate = [](MWMechanics::DynamicStat<float> &oldVal, MWMechanics::DynamicStat<float> &newVal, int limit) { auto needUpdate = [](MWMechanics::DynamicStat<float> &oldVal, MWMechanics::DynamicStat<float> &newVal, int limit) {
return oldVal != newVal && (newVal.getCurrent() == 0 || oldVal.getCurrent() == 0 return oldVal != newVal && (newVal.getCurrent() == 0 || oldVal.getCurrent() == 0
|| abs(oldVal.getCurrent() - newVal.getCurrent()) > limit); || abs(oldVal.getCurrent() - newVal.getCurrent()) >= limit);
}; };
if (forceUpdate || needUpdate(oldHealth, health, 5) || needUpdate(oldMagicka, magicka, 10) || if (forceUpdate || needUpdate(oldHealth, health, 3) || needUpdate(oldMagicka, magicka, 7) ||
needUpdate(oldFatigue, fatigue, 10)) needUpdate(oldFatigue, fatigue, 7))
{ {
oldHealth = health; oldHealth = health;
oldMagicka = magicka; oldMagicka = magicka;