SW: If a saved load is loaded at a point which is right after killing

a boss, ensure that FinishTimer and FinishAnim are appropriately
updated. This commit bumps GameVersion.
Additionally, the set of FinishAnim to 0 in NewLevel had
to move to a different location (InitLevelGlobals2), so
it doesn't override the value stored in the saved game.

# Conflicts:
#	source/sw/src/game.cpp
This commit is contained in:
NY00123 2020-07-13 23:20:14 +03:00 committed by Christoph Oelckers
parent 9caf1ead91
commit 829bc10ccb
2 changed files with 10 additions and 3 deletions

View File

@ -141,8 +141,7 @@ SWBOOL Global_PLock = TRUE;
SWBOOL Global_PLock = FALSE;
#endif
// 12 was original source release. For future releases increment by two.
int GameVersion = 17;
int GameVersion = 20;
char DemoText[3][64];
int DemoTextYstart = 0;
@ -944,6 +943,7 @@ void InitLevelGlobals2(void)
InitTimingVars();
TotalKillable = 0;
Bunny_Count = 0;
FinishAnim = 0;
}
void
@ -1340,7 +1340,6 @@ void NewLevel(void)
STAT_Update(true);
}
}
FinishAnim = 0;
}

View File

@ -82,6 +82,8 @@ extern SWBOOL NewGame;
extern char CacheLastLevel[];
extern short PlayingLevel;
extern int GodMode;
extern int FinishTimer;
extern SWBOOL FinishAnim;
extern int GameVersion;
//extern short Zombies;
@ -664,6 +666,9 @@ bool GameInterface::SaveGame(FSaveGameNode *sv)
MWRITE(UserMapName,sizeof(UserMapName),1,fil);
MWRITE(&GodMode,sizeof(GodMode),1,fil);
MWRITE(&FinishTimer,sizeof(FinishTimer),1,fil);
MWRITE(&FinishAnim,sizeof(FinishAnim),1,fil);
MWRITE(&serpwasseen, sizeof(serpwasseen), 1, fil);
MWRITE(&sumowasseen, sizeof(sumowasseen), 1, fil);
MWRITE(&zillawasseen, sizeof(zillawasseen), 1, fil);
@ -1054,6 +1059,9 @@ bool GameInterface::LoadGame(FSaveGameNode* sv)
MREAD(UserMapName,sizeof(UserMapName),1,fil);
MREAD(&GodMode,sizeof(GodMode),1,fil);
MREAD(&FinishTimer,sizeof(FinishTimer),1,fil);
MREAD(&FinishAnim,sizeof(FinishAnim),1,fil);
MREAD(&serpwasseen, sizeof(serpwasseen), 1, fil);
MREAD(&sumowasseen, sizeof(sumowasseen), 1, fil);
MREAD(&zillawasseen, sizeof(zillawasseen), 1, fil);