From ac3254d85f6e1359103cd6ce72dcae667f07c0e2 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 31 Aug 2017 18:21:38 +0300 Subject: [PATCH] [General] Don't send PlayerAttribute and PlayerSkill packets as werewolf This will prevent the server from overwriting a player's human form stats with their werewolf form stats. Additionally, share PlayerShapeshift packets last when exchanging data with another player. --- .../processors/player/ProcessorPlayerCellChange.hpp | 8 ++++---- apps/openmw/mwmp/LocalPlayer.cpp | 11 +++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp index 38c0195fa..5122c84c1 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp @@ -34,35 +34,35 @@ namespace mwmp LOG_APPEND(Log::LOG_INFO, "- Started information exchange with %s", other->npc.mName.c_str()); - playerController->GetPacket(ID_PLAYER_SHAPESHIFT)->setPlayer(other); playerController->GetPacket(ID_PLAYER_STATS_DYNAMIC)->setPlayer(other); playerController->GetPacket(ID_PLAYER_ATTRIBUTE)->setPlayer(other); playerController->GetPacket(ID_PLAYER_POSITION)->setPlayer(other); playerController->GetPacket(ID_PLAYER_SKILL)->setPlayer(other); playerController->GetPacket(ID_PLAYER_EQUIPMENT)->setPlayer(other); playerController->GetPacket(ID_PLAYER_ANIM_FLAGS)->setPlayer(other); + playerController->GetPacket(ID_PLAYER_SHAPESHIFT)->setPlayer(other); - playerController->GetPacket(ID_PLAYER_SHAPESHIFT)->Send(pl->guid); playerController->GetPacket(ID_PLAYER_STATS_DYNAMIC)->Send(pl->guid); playerController->GetPacket(ID_PLAYER_ATTRIBUTE)->Send(pl->guid); playerController->GetPacket(ID_PLAYER_POSITION)->Send(pl->guid); playerController->GetPacket(ID_PLAYER_SKILL)->Send(pl->guid); playerController->GetPacket(ID_PLAYER_EQUIPMENT)->Send(pl->guid); playerController->GetPacket(ID_PLAYER_ANIM_FLAGS)->Send(pl->guid); + playerController->GetPacket(ID_PLAYER_SHAPESHIFT)->Send(pl->guid); - playerController->GetPacket(ID_PLAYER_SHAPESHIFT)->setPlayer(pl); playerController->GetPacket(ID_PLAYER_STATS_DYNAMIC)->setPlayer(pl); playerController->GetPacket(ID_PLAYER_ATTRIBUTE)->setPlayer(pl); playerController->GetPacket(ID_PLAYER_SKILL)->setPlayer(pl); playerController->GetPacket(ID_PLAYER_EQUIPMENT)->setPlayer(pl); playerController->GetPacket(ID_PLAYER_ANIM_FLAGS)->setPlayer(pl); + playerController->GetPacket(ID_PLAYER_SHAPESHIFT)->setPlayer(pl); - playerController->GetPacket(ID_PLAYER_SHAPESHIFT)->Send(other->guid); playerController->GetPacket(ID_PLAYER_STATS_DYNAMIC)->Send(other->guid); playerController->GetPacket(ID_PLAYER_ATTRIBUTE)->Send(other->guid); playerController->GetPacket(ID_PLAYER_SKILL)->Send(other->guid); playerController->GetPacket(ID_PLAYER_EQUIPMENT)->Send(other->guid); playerController->GetPacket(ID_PLAYER_ANIM_FLAGS)->Send(other->guid); + playerController->GetPacket(ID_PLAYER_SHAPESHIFT)->Send(other->guid); LOG_APPEND(Log::LOG_INFO, "- Finished information exchange with %s", other->npc.mName.c_str()); }); diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index c26c2494a..cef392ff1 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -93,8 +93,15 @@ void LocalPlayer::update() updateDeadState(); updateEquipment(); updateStatsDynamic(); - updateAttributes(); - updateSkills(); + + // Only send attributes and skills if we are not a werewolf, or they will be + // overwritten by the werewolf ones + if (!isWerewolf) + { + updateAttributes(); + updateSkills(); + } + updateLevel(); updateBounty(); }