mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-24 21:38:39 -04:00
don't let failed loadgame attempts reset gameepisode/gamemap (#643)
This commit is contained in:
parent
7668757f0e
commit
8521c10309
26
src/g_game.c
26
src/g_game.c
@ -1683,16 +1683,16 @@ char* G_MBFSaveGameName(int slot)
|
||||
//
|
||||
// killough 12/98: use faster algorithm which has less IO
|
||||
|
||||
ULong64 G_Signature(void)
|
||||
static ULong64 G_Signature(int sig_epi, int sig_map)
|
||||
{
|
||||
ULong64 s = 0;
|
||||
int lump, i;
|
||||
char name[9];
|
||||
|
||||
if (gamemode == commercial)
|
||||
sprintf(name, "map%02d", gamemap);
|
||||
sprintf(name, "map%02d", sig_map);
|
||||
else
|
||||
sprintf(name, "E%dM%d", gameepisode, gamemap);
|
||||
sprintf(name, "E%dM%d", sig_epi, sig_map);
|
||||
|
||||
lump = W_CheckNumForName(name);
|
||||
|
||||
@ -1739,7 +1739,7 @@ static void G_DoSaveGame(void)
|
||||
*save_p++ = gamemap;
|
||||
|
||||
{ // killough 3/16/98, 12/98: store lump name checksum
|
||||
uint64_t checksum = G_Signature();
|
||||
uint64_t checksum = G_Signature(gameepisode, gamemap);
|
||||
saveg_write64(checksum);
|
||||
}
|
||||
|
||||
@ -1818,6 +1818,7 @@ static void G_DoLoadGame(void)
|
||||
int length, i;
|
||||
char vcheck[VERSIONSIZE];
|
||||
byte saveg_complevel = 203;
|
||||
int tmp_compat, tmp_skill, tmp_epi, tmp_map;
|
||||
|
||||
// [crispy] loaded game must always be single player.
|
||||
// Needed for ability to use a further game loading, as well as
|
||||
@ -1860,16 +1861,15 @@ static void G_DoLoadGame(void)
|
||||
}
|
||||
|
||||
// killough 2/14/98: load compatibility mode
|
||||
compatibility = *save_p++;
|
||||
tmp_compat = *save_p++;
|
||||
|
||||
gameskill = *save_p++;
|
||||
gameepisode = *save_p++;
|
||||
gamemap = *save_p++;
|
||||
gamemapinfo = G_LookupMapinfo(gameepisode, gamemap);
|
||||
tmp_skill = *save_p++;
|
||||
tmp_epi = *save_p++;
|
||||
tmp_map = *save_p++;
|
||||
|
||||
if (!forced_loadgame)
|
||||
{ // killough 3/16/98, 12/98: check lump name checksum
|
||||
uint64_t checksum = G_Signature();
|
||||
uint64_t checksum = G_Signature(tmp_epi, tmp_map);
|
||||
uint64_t rchecksum = saveg_read64();
|
||||
if (checksum != rchecksum)
|
||||
{
|
||||
@ -1886,6 +1886,12 @@ static void G_DoLoadGame(void)
|
||||
|
||||
while (*save_p++);
|
||||
|
||||
compatibility = tmp_compat;
|
||||
gameskill = tmp_skill;
|
||||
gameepisode = tmp_epi;
|
||||
gamemap = tmp_map;
|
||||
gamemapinfo = G_LookupMapinfo(gameepisode, gamemap);
|
||||
|
||||
for (i=0 ; i<MAXPLAYERS ; i++)
|
||||
playeringame[i] = *save_p++;
|
||||
save_p += MIN_MAXPLAYERS-MAXPLAYERS; // killough 2/28/98
|
||||
|
@ -67,7 +67,6 @@ byte *G_ReadOptionsMBF21(byte *demo_p);
|
||||
byte *G_WriteOptions(byte *demo_p); // killough 3/1/98
|
||||
void G_PlayerReborn(int player);
|
||||
void G_DoVictory(void);
|
||||
ULong64 G_Signature(void); // killough 12/98
|
||||
|
||||
int G_ValidateMapName(const char *mapname, int *pEpi, int *pMap);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user