mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +00:00
Grand Prix Backup: Store lumpnamehashes of all maps in queue for extra confirmation that the cup's contents are the same between gameboots.
This commit is contained in:
parent
8199437e0d
commit
3474fd6e83
1 changed files with 28 additions and 1 deletions
|
|
@ -5379,6 +5379,17 @@ static inline void P_ArchiveMisc(savebuffer_t *save)
|
||||||
WRITEUINT8(save->p, roundqueue.size);
|
WRITEUINT8(save->p, roundqueue.size);
|
||||||
WRITEUINT8(save->p, roundqueue.roundnum);
|
WRITEUINT8(save->p, roundqueue.roundnum);
|
||||||
|
|
||||||
|
UINT8 i;
|
||||||
|
for (i = 0; i < roundqueue.size; i++)
|
||||||
|
{
|
||||||
|
UINT16 mapnum = roundqueue.entries[i].mapnum;
|
||||||
|
UINT32 val = 0; // no good default, will all-but-guarantee bad save
|
||||||
|
if (mapnum < nummapheaders && mapheaderinfo[mapnum] != NULL)
|
||||||
|
val = mapheaderinfo[mapnum]->lumpnamehash;
|
||||||
|
|
||||||
|
WRITEUINT32(save->p, val);
|
||||||
|
}
|
||||||
|
|
||||||
WRITEUINT8(save->p, (marathonmode & ~MA_INIT));
|
WRITEUINT8(save->p, (marathonmode & ~MA_INIT));
|
||||||
|
|
||||||
UINT32 writetime = marathontime;
|
UINT32 writetime = marathontime;
|
||||||
|
|
@ -5469,7 +5480,7 @@ static boolean P_UnArchiveSPGame(savebuffer_t *save)
|
||||||
|
|
||||||
if (roundqueue.size != size)
|
if (roundqueue.size != size)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_ERROR, "P_UnArchiveSPGame: Cup \"%s\"'s level composition has changed between game launches.\n", cupname);
|
CONS_Alert(CONS_ERROR, "P_UnArchiveSPGame: Cup \"%s\"'s level composition has changed between game launches (differs in level count).\n", cupname);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5479,6 +5490,22 @@ static boolean P_UnArchiveSPGame(savebuffer_t *save)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UINT8 i;
|
||||||
|
for (i = 0; i < roundqueue.size; i++)
|
||||||
|
{
|
||||||
|
UINT32 val = READUINT32(save->p);
|
||||||
|
UINT16 mapnum = roundqueue.entries[i].mapnum;
|
||||||
|
|
||||||
|
if (mapnum < nummapheaders && mapheaderinfo[mapnum] != NULL)
|
||||||
|
{
|
||||||
|
if (mapheaderinfo[mapnum]->lumpnamehash == val)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
CONS_Alert(CONS_ERROR, "P_UnArchiveSPGame: Cup \"%s\"'s level composition has changed between game launches (differs at level %u).\n", cupname, i);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
marathonmode = READUINT8(save->p);
|
marathonmode = READUINT8(save->p);
|
||||||
marathontime = READUINT32(save->p);
|
marathontime = READUINT32(save->p);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue