mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 22:06:45 +00:00
[Client] Clean up WorldEvent::runConsoleCommands() slightly
This commit is contained in:
parent
ce5670e57e
commit
aa448523f8
1 changed files with 4 additions and 8 deletions
|
@ -485,24 +485,20 @@ void WorldEvent::runConsoleCommands(MWWorld::CellStore* cellStore)
|
||||||
|
|
||||||
if (worldObject.isPlayer)
|
if (worldObject.isPlayer)
|
||||||
{
|
{
|
||||||
BasePlayer *player = 0;
|
|
||||||
|
|
||||||
if (worldObject.guid == Main::get().getLocalPlayer()->guid)
|
if (worldObject.guid == Main::get().getLocalPlayer()->guid)
|
||||||
{
|
{
|
||||||
player = Main::get().getLocalPlayer();
|
|
||||||
|
|
||||||
LOG_APPEND(Log::LOG_VERBOSE, "-- running on local player");
|
LOG_APPEND(Log::LOG_VERBOSE, "-- running on local player");
|
||||||
windowManager->setConsolePtr(static_cast<LocalPlayer*>(player)->getPlayerPtr());
|
windowManager->setConsolePtr(Main::get().getLocalPlayer()->getPlayerPtr());
|
||||||
windowManager->executeCommandInConsole(consoleCommand);
|
windowManager->executeCommandInConsole(consoleCommand);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player = PlayerList::getPlayer(worldObject.guid);
|
DedicatedPlayer *player = PlayerList::getPlayer(worldObject.guid);
|
||||||
|
|
||||||
if (player != 0)
|
if (player != 0)
|
||||||
{
|
{
|
||||||
LOG_APPEND(Log::LOG_VERBOSE, "-- running on player %s", player->npc.mName.c_str());
|
LOG_APPEND(Log::LOG_VERBOSE, "-- running on player %s", player->npc.mName.c_str());
|
||||||
windowManager->setConsolePtr(static_cast<DedicatedPlayer*>(player)->getPtr());
|
windowManager->setConsolePtr(player->getPtr());
|
||||||
windowManager->executeCommandInConsole(consoleCommand);
|
windowManager->executeCommandInConsole(consoleCommand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -525,7 +521,7 @@ void WorldEvent::runConsoleCommands(MWWorld::CellStore* cellStore)
|
||||||
}
|
}
|
||||||
|
|
||||||
windowManager->clearConsolePtr();
|
windowManager->clearConsolePtr();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldEvent::setLocalShorts(MWWorld::CellStore* cellStore)
|
void WorldEvent::setLocalShorts(MWWorld::CellStore* cellStore)
|
||||||
|
|
Loading…
Reference in a new issue