Fix names of savegames. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4781 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2014-11-30 04:56:09 +00:00
parent f8d4b6c9ef
commit 19396e39e6
2 changed files with 10 additions and 1 deletions

View file

@ -8982,7 +8982,16 @@ FAKE_F3:
g_screenCapture = 0;
if (g_lastSaveSlot >= 0)
{
// dirty hack... char 127 in last position indicates an auto-filled name
if (ud.savegame[g_lastSaveSlot][MAXSAVEGAMENAME-2] == 127)
{
Bstrncpy(&ud.savegame[g_lastSaveSlot][0], MapInfo[ud.volume_number * MAXLEVELS + ud.level_number].name, 19);
ud.savegame[g_lastSaveSlot][MAXSAVEGAMENAME-2] = 127;
}
G_SavePlayerMaybeMulti(g_lastSaveSlot);
}
}
if (KB_UnBoundKeyPressed(sc_F7))

View file

@ -2620,7 +2620,7 @@ static int32_t M_MenuEntryStringSubmit(MenuEntry_t *entry, char *input)
{
case MENU_SAVE:
// dirty hack... char 127 in last position indicates an auto-filled name
if (ud.savegame[M_SAVE.currentEntry][0] == 0 || (ud.savegame[M_SAVE.currentEntry][MAXSAVEGAMENAME-2] == 127 &&
if (input[0] == 0 || (ud.savegame[M_SAVE.currentEntry][MAXSAVEGAMENAME-2] == 127 &&
save_xxh == XXH32((uint8_t *)&ud.savegame[M_SAVE.currentEntry][0], 19, 0xDEADBEEF)))
{
Bstrncpy(&ud.savegame[M_SAVE.currentEntry][0], MapInfo[ud.volume_number * MAXLEVELS + ud.level_number].name, 19);