Skip to content

Commit

Permalink
All Games: Attempt to restart the title loop should savegame loading …
Browse files Browse the repository at this point in the history
…fail

Whatever the reason for the failure, attempt to recover, returning to
the title loop if necessary.
  • Loading branch information
danij-deng committed Mar 13, 2014
1 parent c92c165 commit dd570b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doomsday/plugins/common/src/g_game.cpp
Expand Up @@ -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?
Expand All @@ -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()
Expand Down

0 comments on commit dd570b6

Please sign in to comment.