From d7d4dec2009ca84da1f2e163d32c90aa4c871464 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 9 May 2017 12:27:59 +0300 Subject: [PATCH] [Client] Don't spam AnimFlags packets when a Player or Actor is flying --- apps/openmw/mwmp/LocalActor.cpp | 8 ++++---- apps/openmw/mwmp/LocalPlayer.cpp | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwmp/LocalActor.cpp b/apps/openmw/mwmp/LocalActor.cpp index 5208beabf..b151caade 100644 --- a/apps/openmw/mwmp/LocalActor.cpp +++ b/apps/openmw/mwmp/LocalActor.cpp @@ -104,12 +104,12 @@ void LocalActor::updateAnimFlags(bool forceUpdate) MWMechanics::DrawState_ currentDrawState = ptr.getClass().getCreatureStats(ptr).getDrawState(); - if (wasRunning != isRunning || - wasSneaking != isSneaking || wasForceJumping != isForceJumping || - wasForceMoveJumping != isForceMoveJumping || lastDrawState != currentDrawState || - wasFlying || isFlying || + if (wasRunning != isRunning || wasSneaking != isSneaking || + wasForceJumping != isForceJumping || wasForceMoveJumping != isForceMoveJumping || + lastDrawState != currentDrawState || wasFlying != isFlying || forceUpdate) { + wasRunning = isRunning; wasSneaking = isSneaking; wasForceJumping = isForceJumping; diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 61f1919e9..3a7ee1a3d 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -596,7 +596,7 @@ void LocalPlayer::updateAnimFlags(bool forceUpdate) if (wasRunning != isRunning || wasSneaking != isSneaking || wasForceJumping != isForceJumping || wasForceMoveJumping != isForceMoveJumping || lastDrawState != currentDrawState || - wasJumping || isJumping || wasFlying || isFlying || + wasJumping || isJumping || wasFlying != isFlying || forceUpdate) { wasSneaking = isSneaking; @@ -1036,7 +1036,6 @@ void LocalPlayer::sendCellStates() LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_PLAYER_CELL_STATE to server"); getNetworking()->getPlayerPacket(ID_PLAYER_CELL_STATE)->setPlayer(this); getNetworking()->getPlayerPacket(ID_PLAYER_CELL_STATE)->Send(); - } void LocalPlayer::sendSpellAddition(std::string id)