Skip to content

Commit

Permalink
Fixed|All Games: Read-only cvar "game-save-last-slot" incorrect
Browse files Browse the repository at this point in the history
The last-used slot number should be determined from the slot id.
  • Loading branch information
danij-deng committed May 12, 2014
1 parent 519cba5 commit 30e9e63
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions doomsday/plugins/common/src/g_game.cpp
Expand Up @@ -1490,10 +1490,11 @@ static void runGameAction()
// Attempt to load the saved game session.
try
{
COMMON_GAMESESSION->load(G_SaveSlots()[gaLoadSessionSlot].saveName());
SaveSlot const &sslot = G_SaveSlots()[gaLoadSessionSlot];
COMMON_GAMESESSION->load(sslot.saveName());

// Make note of the last used save slot.
Con_SetInteger2("game-save-last-slot", gaLoadSessionSlot.toInt(), SVF_WRITE_OVERRIDE);
Con_SetInteger2("game-save-last-slot", sslot.id().toInt(), SVF_WRITE_OVERRIDE);
}
catch(de::Error const &er)
{
Expand All @@ -1511,11 +1512,11 @@ static void runGameAction()
case GA_SAVESESSION:
try
{
COMMON_GAMESESSION->save(G_SaveSlots()[gaSaveSessionSlot].saveName(),
gaSaveSessionUserDescription);
SaveSlot const &sslot = G_SaveSlots()[gaSaveSessionSlot];
COMMON_GAMESESSION->save(sslot.saveName(), gaSaveSessionUserDescription);

// Make note of the last used save slot.
Con_SetInteger2("game-save-last-slot", gaSaveSessionSlot.toInt(), SVF_WRITE_OVERRIDE);
Con_SetInteger2("game-save-last-slot", sslot.id().toInt(), SVF_WRITE_OVERRIDE);
}
catch(de::Error const &er)
{
Expand Down

0 comments on commit 30e9e63

Please sign in to comment.