From 3e6e5bc0ce1d384d96b464377319ecae0a36222e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 17 Dec 2011 13:28:12 +1100 Subject: TSAGE: Bugfix to allow loading savegames in Blue Force directly from the launcher --- engines/tsage/blue_force/blueforce_logic.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index 9888f4dd91..91cba43e1d 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -20,6 +20,7 @@ * */ +#include "common/config-manager.h" #include "tsage/blue_force/blueforce_logic.h" #include "tsage/blue_force/blueforce_dialogs.h" #include "tsage/blue_force/blueforce_scenes0.h" @@ -42,8 +43,25 @@ namespace TsAGE { namespace BlueForce { void BlueForceGame::start() { - // Start the game - g_globals->_sceneManager.changeScene(20); + int slot = -1; + + // Check for a savegame to load straight from the launcher + if (ConfMan.hasKey("save_slot")) { + slot = ConfMan.getInt("save_slot"); + Common::String file = g_vm->generateSaveName(slot); + Common::InSaveFile *in = g_vm->_system->getSavefileManager()->openForLoading(file); + if (in) + delete in; + else + slot = -1; + } + + if (slot >= 0) + // Set the savegame slot to load in the main loop + g_globals->_sceneHandler->_loadGameSlot = slot; + else + // Switch to the title screen + g_globals->_sceneManager.setNewScene(20); } Scene *BlueForceGame::createScene(int sceneNumber) { -- cgit v1.2.3