Fix typo in savegame file name in menu_GameLoad(). Have made this a macro now.

This commit is contained in:
sirlemonhead 2019-10-29 21:28:14 +00:00 committed by Christoph Oelckers
parent ec2f8715fc
commit 0dbb073b0a

View file

@ -28,6 +28,7 @@
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#define kSaveFileName "savgamea.sav"
#define kMaxSaveSlots 5 #define kMaxSaveSlots 5
#define kMaxSaveSlotChars 25 #define kMaxSaveSlotChars 25
@ -1003,13 +1004,13 @@ int menu_NewGameMenu()
int nSlot = 0; int nSlot = 0;
FILE *fp = fopen("savgamea.sav", "rb"); FILE *fp = fopen(kSaveFileName, "rb");
if (fp == NULL) if (fp == NULL)
{ {
memset(nameList, 0, nNameLen); memset(nameList, 0, nNameLen);
memset(&GameStats, 0, sizeof(GameStat)); memset(&GameStats, 0, sizeof(GameStat));
fp = fopen("savgamea.sav", "wb+"); fp = fopen(kSaveFileName, "wb+");
if (fp != NULL) if (fp != NULL)
{ {
fwrite(nameList, nNameLen, 1, fp); fwrite(nameList, nNameLen, 1, fp);
@ -1189,7 +1190,7 @@ check_keys:
} }
} }
FILE *fp = fopen("savgamea.sav", "rb+"); FILE *fp = fopen(kSaveFileName, "rb+");
if (fp == NULL) { if (fp == NULL) {
return -1; return -1;
} }
@ -1286,7 +1287,7 @@ int menu_LoadGameMenu()
int nSlot = 0; int nSlot = 0;
FILE *fp = fopen("savgamea.sav", "rb"); FILE *fp = fopen(kSaveFileName, "rb");
if (fp == NULL) if (fp == NULL)
{ {
memset(nameList, 0, sizeof(nameList)); memset(nameList, 0, sizeof(nameList));
@ -1410,7 +1411,7 @@ short menu_GameLoad(int nSlot)
{ {
memset(&GameStats, 0, sizeof(GameStats)); memset(&GameStats, 0, sizeof(GameStats));
FILE *fp = fopen("savegamea.sav", "rb"); FILE *fp = fopen(kSaveFileName, "rb");
if (fp == NULL) { if (fp == NULL) {
return 0; return 0;
} }
@ -1446,7 +1447,7 @@ void menu_GameSave(int nSaveSlot)
return; return;
} }
FILE *fp = fopen("savgamea.sav", "rb+"); FILE *fp = fopen(kSaveFileName, "rb+");
if (fp != NULL) if (fp != NULL)
{ {
fseek(fp, 125, SEEK_SET); // skip save slot names fseek(fp, 125, SEEK_SET); // skip save slot names