From 6bf405eb181c62294891467eed62111299c17a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Wed, 26 Mar 2025 23:41:41 +0100 Subject: [PATCH] Codechange: Remove Game::GetGameInstance() (duplicate of Game::GetInstance()) (#13901) --- src/game/game.hpp | 5 ----- src/game/game_instance.cpp | 4 ++-- src/script/script_gui.cpp | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/game/game.hpp b/src/game/game.hpp index c560d7263c..036ebfe44a 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -64,11 +64,6 @@ public: */ static void NewEvent(class ScriptEvent *event); - /** - * Get the current GameScript instance. - */ - static class GameInstance *GetGameInstance() { return Game::instance.get(); } - /** * Get the current GameInfo. */ diff --git a/src/game/game_instance.cpp b/src/game/game_instance.cpp index fa4617de82..8c30da998d 100644 --- a/src/game/game_instance.cpp +++ b/src/game/game_instance.cpp @@ -94,8 +94,8 @@ void GameInstance::Died() */ void CcGame(Commands cmd, const CommandCost &result, const CommandDataBuffer &data, CommandDataBuffer result_data) { - if (Game::GetGameInstance()->DoCommandCallback(result, data, std::move(result_data), cmd)) { - Game::GetGameInstance()->Continue(); + if (Game::GetInstance()->DoCommandCallback(result, data, std::move(result_data), cmd)) { + Game::GetInstance()->Continue(); } } diff --git a/src/script/script_gui.cpp b/src/script/script_gui.cpp index d92c069e5d..b2a4930581 100644 --- a/src/script/script_gui.cpp +++ b/src/script/script_gui.cpp @@ -1311,7 +1311,7 @@ void ShowScriptDebugWindowIfScriptError() } } - GameInstance *g = Game::GetGameInstance(); + GameInstance *g = Game::GetInstance(); if (g != nullptr && g->IsDead()) { ShowScriptDebugWindow(OWNER_DEITY); }