Skip to content

Commit

Permalink
fix not setting gamesignature for savestates
Browse files Browse the repository at this point in the history
  • Loading branch information
joyrider3774 committed Jul 25, 2024
1 parent 9834cf6 commit ebe87d9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/savestate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@

game_signature GameSignature;

#define LevelLockPosition 1000 //in case i ever add any new levels or options
#define optionMusicPosition (sizeof(game_signature))
#define optionSoundPosition (optionMusicPosition + sizeof(music_on))
#define optionSkinPosition (optionSoundPosition + sizeof(sound_on))
#define optionGameHelpBarPosition (optionSkinPosition + sizeof(skin))

int[MaxLevelPacks] levelLocks = {0,0};
int musicOn;
int soundOn;
int skin;
int valid;
int gamehelpbar;

#define LevelLockPosition 1000 //in case i ever add any new levels or options
#define optionMusicPosition (sizeof(game_signature))
#define optionSoundPosition (optionMusicPosition + sizeof(music_on))
#define optionSkinPosition (optionSoundPosition + sizeof(sound_on))
#define optionGameHelpBarPosition (optionSkinPosition + sizeof(skin))

void loadSaveState(void)
{
Expand Down Expand Up @@ -61,7 +60,7 @@ void saveSaveState(void)
void validateSaveState(void)
{

if ((gamehelpbar > 1) || (gamehelpbar < 0) || !valid)
if ((gamehelpbar > 1) || (gamehelpbar < 0) || !valid)
{
valid = 0;
gamehelpbar = 1;
Expand Down Expand Up @@ -103,6 +102,8 @@ void validateSaveState(void)

void initSaveState(void)
{
memset( &GameSignature, 0, sizeof( game_signature ) );
strcpy( GameSignature, "BLOCKDUDE_V1" );
valid = 1;
loadSaveState();
validateSaveState();
Expand Down

0 comments on commit ebe87d9

Please sign in to comment.