aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control/pet_load.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/pet_control/pet_load.cpp')
-rw-r--r--engines/titanic/pet_control/pet_load.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/engines/titanic/pet_control/pet_load.cpp b/engines/titanic/pet_control/pet_load.cpp
index cb3514ee56..04eec54f25 100644
--- a/engines/titanic/pet_control/pet_load.cpp
+++ b/engines/titanic/pet_control/pet_load.cpp
@@ -24,6 +24,7 @@
#include "titanic/pet_control/pet_control.h"
#include "titanic/core/project_item.h"
#include "titanic/game_manager.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -57,16 +58,10 @@ void CPetLoad::execute() {
CPetControl *pet = getPetControl();
if (_savegameSlotNum >= 0 && _slotInUse[_savegameSlotNum]) {
- CProjectItem *project = pet ? pet->getRoot() : nullptr;
- CGameManager *gameManager = project ? project->getGameManager() : nullptr;
+ CMainGameWindow *window = g_vm->_window;
- if (project && gameManager) {
- pet->displayMessage("Loading the selected game, please wait.");
-
- gameManager->destroyTreeItem();
- gameManager->initBounds();
- project->loadGame(_savegameSlotNum);
- }
+ // WORKAROUND: Schedule the savegame to be loaded after frame rendering ends
+ window->loadGame(_savegameSlotNum);
} else if (pet) {
pet->displayMessage("You must select a game to load first.");
}