[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
*/
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
*/

View file

@ -161,11 +161,11 @@ void LocalActor::updateStatsDynamic(bool forceUpdate)
auto needUpdate = [](MWMechanics::DynamicStat<float> &oldVal, MWMechanics::DynamicStat<float> &newVal, int limit) {
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) ||
needUpdate(oldFatigue, fatigue, 10))
if (forceUpdate || needUpdate(oldHealth, health, 3) || needUpdate(oldMagicka, magicka, 7) ||
needUpdate(oldFatigue, fatigue, 7))
{
oldHealth = health;
oldMagicka = magicka;

View file

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