1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-06-24 05:11:37 +00:00

[Client] Fix use of DedicatedPlayers as targets for ConsoleCommand

This commit is contained in:
David Cernat 2018-01-05 01:24:15 +02:00
parent 502df7d9c1
commit a639d3494a

View file

@ -470,15 +470,18 @@ void WorldEvent::runConsoleCommands(MWWorld::CellStore* cellStore)
windowManager->setConsolePtr(static_cast<LocalPlayer*>(player)->getPlayerPtr());
windowManager->executeCommandInConsole(consoleCommand);
}
else if (player != 0)
else
{
player = PlayerList::getPlayer(guid);
player = PlayerList::getPlayer(worldObject.guid);
if (player != 0)
{
LOG_APPEND(Log::LOG_VERBOSE, "-- running on player %s", player->npc.mName.c_str());
windowManager->setConsolePtr(static_cast<DedicatedPlayer*>(player)->getPtr());
windowManager->executeCommandInConsole(consoleCommand);
}
}
}
else
{
LOG_APPEND(Log::LOG_VERBOSE, "-- running on cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum);