mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 03:00:38 +00:00
If you save over an autonamed savegame and change the name, don't overwrite your edit with another autofill.
git-svn-id: https://svn.eduke32.com/eduke32@4858 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
8a68f2d5a9
commit
4bc4735480
1 changed files with 6 additions and 2 deletions
|
@ -2635,14 +2635,18 @@ static int32_t M_MenuEntryStringSubmit(MenuEntry_t *entry, char *input)
|
||||||
case MENU_SAVE:
|
case MENU_SAVE:
|
||||||
// dirty hack... char 127 in last position indicates an auto-filled name
|
// dirty hack... char 127 in last position indicates an auto-filled name
|
||||||
if (input[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)))
|
Bstrncmp(&ud.savegame[M_SAVE.currentEntry][0], input, MAXSAVEGAMENAME-3) == 0 &&
|
||||||
|
save_xxh == XXH32((uint8_t *)&ud.savegame[M_SAVE.currentEntry][0], MAXSAVEGAMENAME-3, 0xDEADBEEF)))
|
||||||
{
|
{
|
||||||
Bstrncpy(&ud.savegame[M_SAVE.currentEntry][0], MapInfo[ud.volume_number * MAXLEVELS + ud.level_number].name, 19);
|
Bstrncpy(&ud.savegame[M_SAVE.currentEntry][0], MapInfo[ud.volume_number * MAXLEVELS + ud.level_number].name, MAXSAVEGAMENAME-3);
|
||||||
ud.savegame[M_SAVE.currentEntry][MAXSAVEGAMENAME-2] = 127;
|
ud.savegame[M_SAVE.currentEntry][MAXSAVEGAMENAME-2] = 127;
|
||||||
returnvar = -1;
|
returnvar = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
ud.savegame[M_SAVE.currentEntry][MAXSAVEGAMENAME-2] = 0;
|
||||||
Bstrncpy(object->variable, input, object->maxlength);
|
Bstrncpy(object->variable, input, object->maxlength);
|
||||||
|
}
|
||||||
|
|
||||||
G_SavePlayerMaybeMulti(M_SAVE.currentEntry);
|
G_SavePlayerMaybeMulti(M_SAVE.currentEntry);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue