From 6918ae7bc71dcf2b9abba19821de8a2bfd5251a0 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 27 May 2017 22:32:28 +0300 Subject: [PATCH] [Client] Don't crash when receiving certain packets from NULL players --- apps/openmw/mwmp/processors/player/ProcessorPlayerFaction.hpp | 4 +++- apps/openmw/mwmp/processors/player/ProcessorPlayerJournal.hpp | 4 +++- apps/openmw/mwmp/processors/player/ProcessorPlayerTopic.hpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerFaction.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerFaction.hpp index a4a250f52..5e9654539 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerFaction.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerFaction.hpp @@ -20,8 +20,10 @@ namespace mwmp { // Entire faction membership cannot currently be requested from players } - else + else if (player != 0) + { static_cast(player)->setFactions(); + } } }; } diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerJournal.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerJournal.hpp index 37725344b..803301b5b 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerJournal.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerJournal.hpp @@ -24,8 +24,10 @@ namespace mwmp { // Entire journal cannot currently be requested from players } - else + else if (player != 0) + { static_cast(player)->addJournalItems(); + } } }; } diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerTopic.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerTopic.hpp index 5b7046885..4a087a346 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerTopic.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerTopic.hpp @@ -20,8 +20,10 @@ namespace mwmp { // Entire list of topics cannot currently be requested from players } - else + else if (player != 0) + { static_cast(player)->addTopics(); + } } }; }