From a639d3494a4befaa97a473b875a3d5ef4e8c20c4 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 5 Jan 2018 01:24:15 +0200 Subject: [PATCH] [Client] Fix use of DedicatedPlayers as targets for ConsoleCommand --- apps/openmw/mwmp/WorldEvent.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwmp/WorldEvent.cpp b/apps/openmw/mwmp/WorldEvent.cpp index 6e4e0b2eb..07e3f4534 100644 --- a/apps/openmw/mwmp/WorldEvent.cpp +++ b/apps/openmw/mwmp/WorldEvent.cpp @@ -470,13 +470,16 @@ void WorldEvent::runConsoleCommands(MWWorld::CellStore* cellStore) windowManager->setConsolePtr(static_cast(player)->getPlayerPtr()); windowManager->executeCommandInConsole(consoleCommand); } - else if (player != 0) + else { - player = PlayerList::getPlayer(guid); + player = PlayerList::getPlayer(worldObject.guid); - LOG_APPEND(Log::LOG_VERBOSE, "-- running on player %s", player->npc.mName.c_str()); - windowManager->setConsolePtr(static_cast(player)->getPtr()); - windowManager->executeCommandInConsole(consoleCommand); + if (player != 0) + { + LOG_APPEND(Log::LOG_VERBOSE, "-- running on player %s", player->npc.mName.c_str()); + windowManager->setConsolePtr(static_cast(player)->getPtr()); + windowManager->executeCommandInConsole(consoleCommand); + } } } else