mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-13 11:32:35 +00:00
G_LoadGamedata: Add a sanity check when imbibing pendingkeyroundoffset
Should solve Laz's infinite key increment hell
This commit is contained in:
parent
798e016aa1
commit
43880b4a4b
1 changed files with 10 additions and 0 deletions
10
src/g_game.c
10
src/g_game.c
|
|
@ -4691,6 +4691,16 @@ void G_LoadGameData(void)
|
|||
gamedata->keyspending = READUINT16(save.p);
|
||||
}
|
||||
|
||||
// Sanity check.
|
||||
if (gamedata->pendingkeyroundoffset >= GDCONVERT_ROUNDSTOKEY)
|
||||
{
|
||||
gamedata->pendingkeyrounds +=
|
||||
(gamedata->pendingkeyroundoffset
|
||||
- (GDCONVERT_ROUNDSTOKEY-1));
|
||||
gamedata->pendingkeyroundoffset = (GDCONVERT_ROUNDSTOKEY-1);
|
||||
gamedata->keyspending = 0; // safe to nuke - will be recalc'd if the offset still permits
|
||||
}
|
||||
|
||||
gamedata->chaokeys = READUINT16(save.p);
|
||||
|
||||
if (versionMinor >= 4)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue