diff --git a/engines/ultima/ultima4/ultima4.cpp b/engines/ultima/ultima4/ultima4.cpp index f9f16f76957..aecfd8ba55e 100644 --- a/engines/ultima/ultima4/ultima4.cpp +++ b/engines/ultima/ultima4/ultima4.cpp @@ -202,6 +202,10 @@ void Ultima4Engine::setToJourneyOnwards() { assert(_saveSlotToLoad); } +bool Ultima4Engine::canLoadGameStateCurrently(bool isAutosave) { + return g_game != nullptr && g_context != nullptr && eventHandler->getController() == g_game; +} + bool Ultima4Engine::canSaveGameStateCurrently(bool isAutosave) { return g_game != nullptr && g_context != nullptr && eventHandler->getController() == g_game && (g_context->_location->_context & CTX_CAN_SAVE_GAME); diff --git a/engines/ultima/ultima4/ultima4.h b/engines/ultima/ultima4/ultima4.h index 29887be0a6d..e4db2d7708f 100644 --- a/engines/ultima/ultima4/ultima4.h +++ b/engines/ultima/ultima4/ultima4.h @@ -98,9 +98,7 @@ public: /** * Returns true if a savegame can be loaded */ - bool canLoadGameStateCurrently(bool isAutosave = false) override { - return canSaveGameStateCurrently(isAutosave); - } + bool canLoadGameStateCurrently(bool isAutosave = false) override; /** * Returns true if the game can be saved