mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
M_PopulateChallengeGrid: Remove bad challengegrid when I_Erroring to prevent corrupted save
This commit is contained in:
parent
06bde8b40e
commit
4f8df12403
1 changed files with 9 additions and 1 deletions
10
src/m_cond.c
10
src/m_cond.c
|
|
@ -214,7 +214,11 @@ quickcheckagain:
|
|||
|
||||
if (nummajorunlocks > 0)
|
||||
{
|
||||
I_Error("M_PopulateChallengeGrid: was not able to populate %d large tiles (width %d)", nummajorunlocks, gamedata->challengegridwidth);
|
||||
UINT16 widthtoprint = gamedata->challengegridwidth;
|
||||
Z_Free(gamedata->challengegrid);
|
||||
gamedata->challengegrid = NULL;
|
||||
|
||||
I_Error("M_PopulateChallengeGrid: was not able to populate %d large tiles (width %d)", nummajorunlocks, widthtoprint);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -232,6 +236,10 @@ quickcheckagain:
|
|||
|
||||
if (numunlocks > numempty)
|
||||
{
|
||||
gamedata->challengegridwidth = 0;
|
||||
Z_Free(gamedata->challengegrid);
|
||||
gamedata->challengegrid = NULL;
|
||||
|
||||
I_Error("M_PopulateChallengeGrid: %d small unlocks vs %d empty spaces (%d gap)", numunlocks, numempty, (numunlocks-numempty));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue