diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 23629808a..d02e1060d 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -107,7 +107,7 @@ add_openmw_dir (mwmp\\processors\\actor ProcessorActorAnimFlags ProcessorActorAn add_openmw_dir (mwmp\\processors\\player ProcessorChatMessage ProcessorGameConsole ProcessorGameTime ProcessorGUIMessageBox ProcessorHandshake ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerBaseInfo ProcessorPlayerCellChange - ProcessorPlayerCellState ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerDrawState + ProcessorPlayerCellState ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerAnimFlags ProcessorPlayerDynamicStats ProcessorPlayerEquipment ProcessorPlayerInventory ProcessorPlayerJournal ProcessorPlayerLevel ProcessorPlayerPos ProcessorPlayerResurrect ProcessorPlayerSkill ProcessorPlayerSpellbook ProcessorUserDisconnected ProcessorUserMyID diff --git a/apps/openmw/mwmp/ProcessorInitializer.cpp b/apps/openmw/mwmp/ProcessorInitializer.cpp index b9d239f8f..a8c75b786 100644 --- a/apps/openmw/mwmp/ProcessorInitializer.cpp +++ b/apps/openmw/mwmp/ProcessorInitializer.cpp @@ -19,7 +19,7 @@ #include "processors/player/ProcessorPlayerDynamicStats.hpp" #include "processors/player/ProcessorPlayerDeath.hpp" #include "processors/player/ProcessorPlayerResurrect.hpp" -#include "processors/player/ProcessorPlayerDrawState.hpp" +#include "processors/player/ProcessorPlayerAnimFlags.hpp" #include "processors/player/ProcessorChatMessage.hpp" #include "processors/player/ProcessorPlayerCharGen.hpp" #include "processors/player/ProcessorGUIMessageBox.hpp" @@ -76,7 +76,7 @@ void ProcessorInitializer() PlayerProcessor::AddProcessor(new ProcessorPlayerDynamicStats()); PlayerProcessor::AddProcessor(new ProcessorPlayerDeath()); PlayerProcessor::AddProcessor(new ProcessorPlayerResurrect()); - PlayerProcessor::AddProcessor(new ProcessorPlayerDrawState()); + PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags()); PlayerProcessor::AddProcessor(new ProcessorChatMessage()); PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen()); PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox()); diff --git a/apps/openmw/mwmp/processors/player/ProcessorChatMessage.hpp b/apps/openmw/mwmp/processors/player/ProcessorChatMessage.hpp index 399d5d057..cdc2c92d8 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorChatMessage.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorChatMessage.hpp @@ -22,7 +22,8 @@ namespace mwmp virtual void Do(PlayerPacket &packet, BasePlayer *player) { - Main::get().getGUIController()->printChatMessage(player->chatMessage); + if (player != 0) + Main::get().getGUIController()->printChatMessage(player->chatMessage); } }; } diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerDrawState.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerAnimFlags.hpp similarity index 66% rename from apps/openmw/mwmp/processors/player/ProcessorPlayerDrawState.hpp rename to apps/openmw/mwmp/processors/player/ProcessorPlayerAnimFlags.hpp index 6aff8f968..e77de681f 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerDrawState.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerAnimFlags.hpp @@ -2,18 +2,18 @@ // Created by koncord on 16.04.17. // -#ifndef OPENMW_PROCESSORPLAYERDRAWSTATE_HPP -#define OPENMW_PROCESSORPLAYERDRAWSTATE_HPP +#ifndef OPENMW_PROCESSORPLAYERANIMFLAGS_HPP +#define OPENMW_PROCESSORPLAYERANIMFLAGS_HPP #include "apps/openmw/mwmp/PlayerProcessor.hpp" namespace mwmp { - class ProcessorPlayerDrawState : public PlayerProcessor + class ProcessorPlayerAnimFlags : public PlayerProcessor { public: - ProcessorPlayerDrawState() + ProcessorPlayerAnimFlags() { BPP_INIT(ID_PLAYER_ANIM_FLAGS) } @@ -25,11 +25,11 @@ namespace mwmp if(isRequest()) static_cast(player)->updateAnimFlags(true); } - else + else if (player != 0) static_cast(player)->updateAnimFlags(); } }; } -#endif //OPENMW_PROCESSORPLAYERDRAWSTATE_HPP +#endif //OPENMW_PROCESSORPLAYERANIMFLAGS_HPP diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerAttack.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerAttack.hpp index 7ee4aca22..d9ded9f56 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerAttack.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerAttack.hpp @@ -27,7 +27,8 @@ namespace mwmp virtual void Do(PlayerPacket &packet, BasePlayer *player) { - Main::get().getMechanicsHelper()->processAttack(player->attack, static_cast(player)->getPtr()); + if (player != 0) + Main::get().getMechanicsHelper()->processAttack(player->attack, static_cast(player)->getPtr()); } }; } diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerAttribute.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerAttribute.hpp index 0a649b5be..6ac649e05 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerAttribute.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerAttribute.hpp @@ -29,7 +29,7 @@ namespace mwmp else static_cast(player)->setAttributes(); } - else + else if (player != 0) { MWWorld::Ptr ptrPlayer = static_cast(player)->getPtr(); MWMechanics::CreatureStats *ptrCreatureStats = &ptrPlayer.getClass().getCreatureStats(ptrPlayer); diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerCellChange.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerCellChange.hpp index 405046135..9ca5cecc2 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerCellChange.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerCellChange.hpp @@ -27,7 +27,7 @@ namespace mwmp else static_cast(player)->setCell(); } - else + else if (player != 0) static_cast(player)->updateCell(); } }; diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerDeath.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerDeath.hpp index 7386ec0f7..afc159a16 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerDeath.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerDeath.hpp @@ -33,7 +33,7 @@ namespace mwmp packet.setPlayer(player); packet.Send(serverAddr); } - else + else if (player != 0) { LOG_APPEND(Log::LOG_INFO, "- Packet was about %s", player->npc.mName.c_str()); diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerDynamicStats.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerDynamicStats.hpp index bf4a79704..c4fd431b7 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerDynamicStats.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerDynamicStats.hpp @@ -27,7 +27,7 @@ namespace mwmp else static_cast(player)->setDynamicStats(); } - else + else if (player != 0) { MWWorld::Ptr ptrPlayer = static_cast(player)->getPtr(); MWMechanics::CreatureStats *ptrCreatureStats = &ptrPlayer.getClass().getCreatureStats(ptrPlayer); diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerEquipment.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerEquipment.hpp index c6cbf1ee8..0e2eac6ae 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerEquipment.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerEquipment.hpp @@ -27,7 +27,7 @@ namespace mwmp else static_cast(player)->setEquipment(); } - else + else if (player != 0) static_cast(player)->updateEquipment(); } }; diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerLevel.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerLevel.hpp index d86acdd7d..6c0dc850d 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerLevel.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerLevel.hpp @@ -27,7 +27,7 @@ namespace mwmp else static_cast(player)->setLevel(); } - else + else if (player != 0) { MWWorld::Ptr ptrPlayer = static_cast(player)->getPtr(); MWMechanics::CreatureStats *ptrCreatureStats = &ptrPlayer.getClass().getCreatureStats(ptrPlayer); diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerPos.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerPos.hpp index 2fbaeb503..c55068993 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerPos.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerPos.hpp @@ -31,7 +31,7 @@ namespace mwmp else static_cast(player)->updatePosition(true); } - else // dedicated player + else if (player != 0) // dedicated player static_cast(player)->updateMarker(); } }; diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerResurrect.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerResurrect.hpp index 05d0c0c58..f19fcebe5 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerResurrect.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerResurrect.hpp @@ -43,7 +43,7 @@ namespace mwmp Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_STATS_DYNAMIC)->setPlayer(player); Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_STATS_DYNAMIC)->Send(serverAddr); } - else + else if (player != 0) { LOG_APPEND(Log::LOG_INFO, "- Packet was about %s", player->npc.mName.c_str()); diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerSkill.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerSkill.hpp index ccfe2d2b4..83970d5f6 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerSkill.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerSkill.hpp @@ -27,7 +27,7 @@ namespace mwmp else static_cast(player)->setSkills(); } - else + else if (player != 0) { MWWorld::Ptr ptrPlayer = static_cast(player)->getPtr(); MWMechanics::NpcStats *ptrNpcStats = &ptrPlayer.getClass().getNpcStats(ptrPlayer); diff --git a/apps/openmw/mwmp/processors/player/ProcessorUserDisconnected.hpp b/apps/openmw/mwmp/processors/player/ProcessorUserDisconnected.hpp index eb3b38e7d..dca44300e 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorUserDisconnected.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorUserDisconnected.hpp @@ -24,7 +24,7 @@ namespace mwmp { if (isLocal()) MWBase::Environment::get().getStateManager()->requestQuit(); - else + else if (player != 0) PlayerList::disconnectPlayer(guid); } };