From 34a46e68112d9ccf23214141653dd5b270ee8556 Mon Sep 17 00:00:00 2001 From: Koncord Date: Thu, 26 Jan 2017 21:42:12 +0800 Subject: [PATCH 1/2] [Client] Simplify hasFinishedCharGen method --- apps/openmw/mwmp/LocalPlayer.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index db382127f..0b26a83ec 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -148,10 +148,7 @@ bool LocalPlayer::charGenThread() bool LocalPlayer::hasFinishedCharGen() { - if (charGenStage.end == 0) - return true; - - return false; + return charGenStage.end == 0; } void LocalPlayer::updateDynamicStats(bool forceUpdate) From ab3c2544b5bcac9240d89c11daf8791395a133f0 Mon Sep 17 00:00:00 2001 From: Koncord Date: Thu, 26 Jan 2017 21:47:28 +0800 Subject: [PATCH 2/2] [Client] Use constant instead magic value --- apps/openmw/mwmp/LocalPlayer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 0b26a83ec..9c651dcc3 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -165,8 +165,9 @@ void LocalPlayer::updateDynamicStats(bool forceUpdate) static MWMechanics::DynamicStat oldFatigue(ptrCreatureStats->getFatigue()); static float timer = 0; + const float timeoutSec = 0.5; - if ((timer += MWBase::Environment::get().getFrameDuration()) >= 0.5 || forceUpdate) + if ((timer += MWBase::Environment::get().getFrameDuration()) >= timeoutSec || forceUpdate) { if (oldHealth != health || oldMagicka != magicka || oldFatigue != fatigue || forceUpdate) {