mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Merge branch 'bak2bak' into 'next'
Autobackup old gamedatas (resolves #1031) Closes #1031 See merge request STJr/SRB2!2030
This commit is contained in:
commit
dd0ea188dd
1 changed files with 11 additions and 0 deletions
11
src/g_game.c
11
src/g_game.c
|
@ -4386,6 +4386,17 @@ void G_LoadGameData(gamedata_t *data)
|
||||||
{
|
{
|
||||||
goto datacorrupt;
|
goto datacorrupt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make a backup of the old data
|
||||||
|
char currentfilename[64];
|
||||||
|
char backupfilename[69];
|
||||||
|
char bak[5];
|
||||||
|
|
||||||
|
strcpy(bak, ".bak");
|
||||||
|
strcpy(currentfilename, gamedatafilename);
|
||||||
|
STRBUFCPY(backupfilename, strcat(currentfilename, bak));
|
||||||
|
|
||||||
|
FIL_WriteFile(va(pandf, srb2home, backupfilename), savebuffer, length);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue