Skip to content

Commit

Permalink
Fixed|Console|All Games: "savegame" handling of user descriptions
Browse files Browse the repository at this point in the history
A user description argument specified to the savegame command was not
used to replace the existing description when overwriting a savegame.
  • Loading branch information
danij-deng committed Apr 12, 2014
1 parent aa935f9 commit da59e2b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions doomsday/plugins/common/src/g_game.cpp
Expand Up @@ -2982,7 +2982,7 @@ static int loadSessionConfirmed(msgresponse_t response, int /*userValue*/, void
DENG2_ASSERT(slotId != 0);
if(response == MSG_YES)
{
G_SetGameActionLoadSession(*slotId);
DD_Executef(true, "loadgame %s confirm", slotId->toUtf8().constData());
}
delete slotId;
return true;
Expand Down Expand Up @@ -3018,8 +3018,8 @@ D_CMD(LoadSession)

S_LocalSound(SFX_QUICKLOAD_PROMPT, NULL);
// Compose the confirmation message.
de::String const &savegameUserDescription = COMMON_GAMESESSION->savedUserDescription(sslot->saveName());
AutoStr *msg = Str_Appendf(AutoStr_NewStd(), QLPROMPT, savegameUserDescription.toUtf8().constData());
de::String const &existingDescription = COMMON_GAMESESSION->savedUserDescription(sslot->saveName());
AutoStr *msg = Str_Appendf(AutoStr_NewStd(), QLPROMPT, existingDescription.toUtf8().constData());
Hu_MsgStart(MSG_YESNO, Str_Text(msg), loadSessionConfirmed, 0, new de::String(sslot->id()));
return true;
}
Expand Down Expand Up @@ -3071,7 +3071,7 @@ static int saveSessionConfirmed(msgresponse_t response, int /*userValue*/, void
DENG2_ASSERT(p != 0);
if(response == MSG_YES)
{
G_SetGameActionSaveSession(p->slotId, &p->userDescription);
DD_Executef(true, "savegame %s \"%s\" confirm", p->slotId.toUtf8().constData(), p->userDescription.toUtf8().constData());
}
delete p;
return true;
Expand Down Expand Up @@ -3110,7 +3110,6 @@ D_CMD(SaveSession)
{
if(sslot->isUserWritable())
{
// A known slot identifier.
de::String userDescription;
if(argc >= 3 && stricmp(argv[2], "confirm"))
{
Expand All @@ -3124,15 +3123,16 @@ D_CMD(SaveSession)
return G_SetGameActionSaveSession(sslot->id(), &userDescription);
}

S_LocalSound(SFX_QUICKSAVE_PROMPT, NULL);

// Compose the confirmation message.
userDescription = COMMON_GAMESESSION->savedUserDescription(sslot->saveName());
AutoStr *msg = Str_Appendf(AutoStr_NewStd(), QSPROMPT, userDescription.toUtf8().constData());
de::String const existingDescription = COMMON_GAMESESSION->savedUserDescription(sslot->saveName());
AutoStr *msg = Str_Appendf(AutoStr_NewStd(), QSPROMPT, existingDescription.toUtf8().constData());

savesessionconfirmed_params_t *parm = new savesessionconfirmed_params_t;
parm->slotId = sslot->id();
parm->userDescription = userDescription;

S_LocalSound(SFX_QUICKSAVE_PROMPT, NULL);
Hu_MsgStart(MSG_YESNO, Str_Text(msg), saveSessionConfirmed, 0, parm);
return true;
}
Expand Down Expand Up @@ -3171,7 +3171,7 @@ static int deleteSavedSessionConfirmed(msgresponse_t response, int /*userValue*/
DENG2_ASSERT(saveName != 0);
if(response == MSG_YES)
{
COMMON_GAMESESSION->removeSaved(*saveName);
DD_Executef(true, "deletegamesave %s confirm", saveName->toUtf8().constData());
}
delete saveName;
return true;
Expand Down Expand Up @@ -3200,8 +3200,8 @@ D_CMD(DeleteSavedSession)
S_LocalSound(SFX_DELETESAVEGAME_CONFIRM, NULL);

// Compose the confirmation message.
de::String const savegameUserDescription = COMMON_GAMESESSION->savedUserDescription(sslot->saveName());
AutoStr *msg = Str_Appendf(AutoStr_NewStd(), DELETESAVEGAME_CONFIRM, savegameUserDescription.toUtf8().constData());
de::String const existingDescription = COMMON_GAMESESSION->savedUserDescription(sslot->saveName());
AutoStr *msg = Str_Appendf(AutoStr_NewStd(), DELETESAVEGAME_CONFIRM, existingDescription.toUtf8().constData());
Hu_MsgStart(MSG_YESNO, Str_Text(msg), deleteSavedSessionConfirmed, 0, new de::String(sslot->saveName()));
}

Expand Down

0 comments on commit da59e2b

Please sign in to comment.