Another authentic struct name

This commit is contained in:
Clownacy 2020-08-11 00:13:35 +01:00
parent e41d4472ec
commit c8e1e7aa0a
2 changed files with 8 additions and 8 deletions

View file

@ -40,7 +40,7 @@ BOOL IsProfile(void)
BOOL SaveProfile(const char *name) BOOL SaveProfile(const char *name)
{ {
FILE *fp; FILE *fp;
PROFILE profile; PROFILEDATA profile;
const char *FLAG = "FLAG"; const char *FLAG = "FLAG";
char path[MAX_PATH]; char path[MAX_PATH];
@ -57,7 +57,7 @@ BOOL SaveProfile(const char *name)
return FALSE; return FALSE;
// Set up profile // Set up profile
memset(&profile, 0, sizeof(PROFILE)); memset(&profile, 0, sizeof(PROFILEDATA));
memcpy(profile.code, gProfileCode, sizeof(profile.code)); memcpy(profile.code, gProfileCode, sizeof(profile.code));
memcpy(profile.FLAG, FLAG, sizeof(profile.FLAG)); memcpy(profile.FLAG, FLAG, sizeof(profile.FLAG));
profile.stage = gStageNo; profile.stage = gStageNo;
@ -80,7 +80,7 @@ BOOL SaveProfile(const char *name)
memcpy(profile.flags, gFlagNPC, sizeof(profile.flags)); memcpy(profile.flags, gFlagNPC, sizeof(profile.flags));
// Write to file // Write to file
fwrite(&profile, sizeof(PROFILE), 1, fp); fwrite(&profile, sizeof(PROFILEDATA), 1, fp);
fclose(fp); fclose(fp);
return TRUE; return TRUE;
@ -89,7 +89,7 @@ BOOL SaveProfile(const char *name)
BOOL LoadProfile(const char *name) BOOL LoadProfile(const char *name)
{ {
FILE *fp; FILE *fp;
PROFILE profile; PROFILEDATA profile;
char path[MAX_PATH]; char path[MAX_PATH];
// Get path // Get path
@ -115,8 +115,8 @@ BOOL LoadProfile(const char *name)
// Read data // Read data
fseek(fp, 0, SEEK_SET); fseek(fp, 0, SEEK_SET);
memset(&profile, 0, sizeof(PROFILE)); memset(&profile, 0, sizeof(PROFILEDATA));
fread(&profile, sizeof(PROFILE), 1, fp); fread(&profile, sizeof(PROFILEDATA), 1, fp);
fclose(fp); fclose(fp);
// Set things // Set things

View file

@ -6,7 +6,7 @@
#include "SelStage.h" #include "SelStage.h"
#include "Stage.h" #include "Stage.h"
typedef struct PROFILE typedef struct PROFILEDATA
{ {
char code[8]; char code[8];
int stage; int stage;
@ -29,7 +29,7 @@ typedef struct PROFILE
signed char permit_mapping[0x80]; signed char permit_mapping[0x80];
char FLAG[4]; char FLAG[4];
unsigned char flags[1000]; unsigned char flags[1000];
} PROFILE; } PROFILEDATA;
extern const char* const gDefaultName; extern const char* const gDefaultName;
extern const char* const gProfileCode; extern const char* const gProfileCode;