ULTIMA4: Implement loading savegames from launcher

This commit is contained in:
Paul Gilbert 2020-03-26 19:25:41 -07:00 committed by Paul Gilbert
parent 365187a9d8
commit beb8f34a55

View File

@ -104,9 +104,9 @@ void Ultima4Engine::startup() {
creatureMgr->getInstance();
++pb;
intro = new IntroController();
if (!skipInfo) {
/* do the intro */
intro = new IntroController();
intro->init();
++pb;
@ -129,6 +129,12 @@ Common::Error Ultima4Engine::run() {
if (!shouldQuit()) {
g_game->init();
int saveSlot = ConfMan.hasKey("save_slot") ? ConfMan.getInt("save_slot") : -1;
if (saveSlot != -1) {
if (loadGameState(saveSlot).getCode() != Common::kNoError)
error("Error loading save");
}
eventHandler->setControllerDone(false);
eventHandler->pushController(g_game);
eventHandler->run();