Skip to content

Commit

Permalink
Small change to optimize how auto save is handled in SaveGameWithName…
Browse files Browse the repository at this point in the history
… function
  • Loading branch information
rui-17 committed Jul 1, 2022
1 parent 2fed209 commit 88047ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SOURCES/GAMEMENU.C
Original file line number Diff line number Diff line change
Expand Up @@ -1363,14 +1363,15 @@ void SaveGameWithName(char* fileName, WORD isAutoSave)
#ifdef WINDOWS_SAVE

//Added this check to make sure if there are S0000.LBA files that can be replaced. This allows to replace save files from previous versions without creating new ones (like TLBA Classic S0000.LBA save files)
if (FindPlayerFile())
//No need to perform this validation if we're doing an auto save
if (!isAutoSave && FindPlayerFile())
{
//Use the already existing save file path name (uses S0000.LBA if it already existed in the save folder)
strcpy(savePath, GamePathname);
}
else
{
//If the file doesn't exist, create a new one with fileName as name
//If the file doesn't exist, create a new one with fileName as name, or replace if it's auto save or existing and not using S0000.LBA naming
strcpy(savePath, PATH_RESSOURCE);
strcat(savePath, fileName);
strcat(savePath, ".LBA");
Expand Down

0 comments on commit 88047ae

Please sign in to comment.