1
0
Fork 0

Codechange: Remove Game::GetGameInstance() (duplicate of Game::GetInstance()) (#13901)

pull/13904/head
Loïc Guilloux 2025-03-26 23:41:41 +01:00 committed by GitHub
parent ff08a22aa4
commit 6bf405eb18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 8 deletions

View File

@ -64,11 +64,6 @@ public:
*/ */
static void NewEvent(class ScriptEvent *event); static void NewEvent(class ScriptEvent *event);
/**
* Get the current GameScript instance.
*/
static class GameInstance *GetGameInstance() { return Game::instance.get(); }
/** /**
* Get the current GameInfo. * Get the current GameInfo.
*/ */

View File

@ -94,8 +94,8 @@ void GameInstance::Died()
*/ */
void CcGame(Commands cmd, const CommandCost &result, const CommandDataBuffer &data, CommandDataBuffer result_data) void CcGame(Commands cmd, const CommandCost &result, const CommandDataBuffer &data, CommandDataBuffer result_data)
{ {
if (Game::GetGameInstance()->DoCommandCallback(result, data, std::move(result_data), cmd)) { if (Game::GetInstance()->DoCommandCallback(result, data, std::move(result_data), cmd)) {
Game::GetGameInstance()->Continue(); Game::GetInstance()->Continue();
} }
} }

View File

@ -1311,7 +1311,7 @@ void ShowScriptDebugWindowIfScriptError()
} }
} }
GameInstance *g = Game::GetGameInstance(); GameInstance *g = Game::GetInstance();
if (g != nullptr && g->IsDead()) { if (g != nullptr && g->IsDead()) {
ShowScriptDebugWindow(OWNER_DEITY); ShowScriptDebugWindow(OWNER_DEITY);
} }