From dd570b6588c22019b5e80f4d7f1495339a691065 Mon Sep 17 00:00:00 2001 From: danij Date: Thu, 13 Mar 2014 14:38:13 +0000 Subject: [PATCH] All Games: Attempt to restart the title loop should savegame loading fail Whatever the reason for the failure, attempt to recover, returning to the title loop if necessary. --- doomsday/plugins/common/src/g_game.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doomsday/plugins/common/src/g_game.cpp b/doomsday/plugins/common/src/g_game.cpp index 62423b10c8..bf4fab1392 100644 --- a/doomsday/plugins/common/src/g_game.cpp +++ b/doomsday/plugins/common/src/g_game.cpp @@ -3270,11 +3270,7 @@ void G_DoLoadSession(de::String slotId) briefDisabled = true; Uri *mapUri = Uri_NewWithPath2(metadata.gets("mapUri").toUtf8().constData(), RC_NULL); - GameRuleset *rules = 0; - if(metadata.hasSubrecord("gameRules")) - { - rules = GameRuleset::fromRecord(metadata.subrecord("gameRules")); - } + GameRuleset *rules = GameRuleset::fromRecord(metadata.subrecord("gameRules")); G_NewSession(mapUri, 0/*not saved??*/, rules); G_SetGameAction(GA_NONE); /// @todo Necessary? @@ -3298,12 +3294,16 @@ void G_DoLoadSession(de::String slotId) G_SaveSlots().copySlot("base", "auto"); } #endif + return; } catch(de::Error const &er) { App_Log(DE2_RES_WARNING, "Error loading save slot #%s:\n%s", slotId.toLatin1().constData(), er.asText().toLatin1().constData()); } + + // Failure... Return to the title loop. + G_StartTitle(); } bool G_SessionSavingPossible()