From 796118c266dcd7c4507db7ffb93adebd200769a1 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Wed, 26 Jul 2017 20:15:35 +0300 Subject: [PATCH] [Client] Send StatsDynamic packets more often --- apps/openmw/mwmechanics/actors.cpp | 2 +- apps/openmw/mwmp/LocalActor.cpp | 6 +++--- apps/openmw/mwmp/LocalPlayer.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index c88c7345e..06a97bb0a 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -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 */ diff --git a/apps/openmw/mwmp/LocalActor.cpp b/apps/openmw/mwmp/LocalActor.cpp index 7465c6216..6ada82ff0 100644 --- a/apps/openmw/mwmp/LocalActor.cpp +++ b/apps/openmw/mwmp/LocalActor.cpp @@ -161,11 +161,11 @@ void LocalActor::updateStatsDynamic(bool forceUpdate) auto needUpdate = [](MWMechanics::DynamicStat &oldVal, MWMechanics::DynamicStat &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; diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 85ffe6f44..e4bc4fda7 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -202,11 +202,11 @@ void LocalPlayer::updateStatsDynamic(bool forceUpdate) // Update stats when they become 0 or they have changed enough auto needUpdate = [](MWMechanics::DynamicStat &oldVal, MWMechanics::DynamicStat &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;