diff --git a/apps/openmw-mp/PlayerProcessor.cpp b/apps/openmw-mp/PlayerProcessor.cpp index e5b34e0e1..8ff803d54 100644 --- a/apps/openmw-mp/PlayerProcessor.cpp +++ b/apps/openmw-mp/PlayerProcessor.cpp @@ -30,6 +30,7 @@ bool PlayerProcessor::Process(RakNet::Packet &packet) noexcept { Player *player = Players::getPlayer(packet.guid); PlayerPacket *myPacket = Networking::get().getPlayerController()->GetPacket(packet.data[0]); + myPacket->setPlayer(player); processor.second->Do(*myPacket, *player); return true; diff --git a/apps/openmw-mp/processors/player/ProcessorChatMsg.hpp b/apps/openmw-mp/processors/player/ProcessorChatMsg.hpp index 3526e9b01..f146113f7 100644 --- a/apps/openmw-mp/processors/player/ProcessorChatMsg.hpp +++ b/apps/openmw-mp/processors/player/ProcessorChatMsg.hpp @@ -22,7 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.setPlayer(&player); packet.Read(); Script::CallBackReturn result = true; Script::Call(result, player.getId(), player.chatMessage.c_str()); @@ -31,8 +30,6 @@ namespace mwmp { player.chatMessage = player.npc.mName + " (" + std::to_string(player.getId()) + "): " + player.chatMessage + "\n"; - - packet.setPlayer(&player); packet.Send(false); packet.Send(true); } diff --git a/apps/openmw-mp/processors/player/ProcessorGUIMessageBox.hpp b/apps/openmw-mp/processors/player/ProcessorGUIMessageBox.hpp index 72ead5631..c3684d1ce 100644 --- a/apps/openmw-mp/processors/player/ProcessorGUIMessageBox.hpp +++ b/apps/openmw-mp/processors/player/ProcessorGUIMessageBox.hpp @@ -22,7 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.setPlayer(&player); packet.Read(); Script::Call(player.getId(), (int)player.guiMessageBox.id, diff --git a/apps/openmw-mp/processors/player/ProcessorLevel.hpp b/apps/openmw-mp/processors/player/ProcessorLevel.hpp index 3bc3257ac..6886ef697 100644 --- a/apps/openmw-mp/processors/player/ProcessorLevel.hpp +++ b/apps/openmw-mp/processors/player/ProcessorLevel.hpp @@ -22,7 +22,6 @@ namespace mwmp { if (!player.creatureStats.mDead) { - packet.setPlayer(&player); packet.Read(); //packet.Send(&player, true); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp index 975a04420..e120f2002 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp @@ -26,8 +26,6 @@ namespace mwmp if (!player.creatureStats.mDead) { - - packet.setPlayer(&player); packet.Read(); Player *target = Players::getPlayer(player.attack.target); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerAttribute.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerAttribute.hpp index e7ea8c2bc..8a9111c3a 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerAttribute.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerAttribute.hpp @@ -22,7 +22,6 @@ namespace mwmp { if (!player.creatureStats.mDead) { - packet.setPlayer(&player); packet.Read(); //myPacket->Send(player, true); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp index 38bc53a9e..38a6ef6a3 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp @@ -28,7 +28,6 @@ namespace mwmp if (!player.creatureStats.mDead) { - packet.setPlayer(&player); packet.Read(); LOG_APPEND(Log::LOG_INFO, "- Moved to %s", player.cell.getDescription().c_str()); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp index 02932c9cb..c658405a7 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp @@ -27,7 +27,6 @@ namespace mwmp { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID, player.npc.mName.c_str()); - packet.setPlayer(&player); packet.Read(); CellController::get()->update(&player); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerCharClass.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerCharClass.hpp index 400064c24..2c9caf4c2 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerCharClass.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerCharClass.hpp @@ -22,7 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.setPlayer(&player); packet.Read(); } }; diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerCharGen.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerCharGen.hpp index 71484c68b..fd24f9b08 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerCharGen.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerCharGen.hpp @@ -22,7 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.setPlayer(&player); packet.Read(); if (player.charGenStage.current == player.charGenStage.end && player.charGenStage.current != 0) diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp index c2053f0a0..18c2bb136 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp @@ -41,7 +41,6 @@ namespace mwmp player.creatureStats.mDead = true; - packet.setPlayer(&player); packet.Send(true); Script::Call(player.getId(), reason, killer->getId()); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerDrawState.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerDrawState.hpp index 7947f6619..7580b53e3 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerDrawState.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerDrawState.hpp @@ -22,7 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.setPlayer(&player); packet.Read(); //packet.Send(&player, true); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerDynamicStats.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerDynamicStats.hpp index bef4010d0..fd7193a55 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerDynamicStats.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerDynamicStats.hpp @@ -22,7 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.setPlayer(&player); packet.Read(); player.sendToLoaded(&packet); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerEquipment.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerEquipment.hpp index 4d81d5553..edb052eb9 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerEquipment.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerEquipment.hpp @@ -22,7 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.setPlayer(&player); packet.Read(); //myPacket->Send(player, true); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerInventory.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerInventory.hpp index 38adad974..df33e2079 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerInventory.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerInventory.hpp @@ -21,7 +21,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.setPlayer(&player); packet.Read(); Script::Call(player.getId()); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp index 59c56a05d..e299da204 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp @@ -22,7 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.setPlayer(&player); packet.Read(); Script::Call(player.getId()); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerPos.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerPos.hpp index 0b92581ef..861f34db4 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerPos.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerPos.hpp @@ -22,7 +22,6 @@ namespace mwmp //DEBUG_PRINTF(strPacketID); if (!player.creatureStats.mDead) { - packet.setPlayer(&player); packet.Read(); //myPacket.Send(player, true); //send to other clients diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp index 5d6a18e96..05c312866 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp @@ -24,7 +24,6 @@ namespace mwmp player.creatureStats.mDead = false; - packet.setPlayer(&player); packet.Send(true); Script::Call(player.getId()); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerSkill.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerSkill.hpp index 77045158e..4c0024ab6 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerSkill.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerSkill.hpp @@ -21,7 +21,6 @@ namespace mwmp { if (!player.creatureStats.mDead) { - packet.setPlayer(&player); packet.Read(); //myPacket->Send(player, true); player.sendToLoaded(&packet); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp index 0869b3ca9..24b869c92 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp @@ -20,8 +20,7 @@ namespace mwmp void Do(PlayerPacket &packet, Player &player) override { DEBUG_PRINTF(strPacketID.c_str()); - - packet.setPlayer(&player); + packet.Read(); Script::Call(player.getId());