mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-09 16:32:33 +00:00
load_ng_gamedata(): No need to free grids/cans, as M_ClearSecrets (called at start) already does. Everything else already assumes it's adding to a blank gamedata...
This commit is contained in:
parent
f390564640
commit
0449156d2e
1 changed files with 1 additions and 27 deletions
|
|
@ -519,23 +519,9 @@ void srb2::load_ng_gamedata()
|
|||
gamedata->achieved[i] = js.conditionsets[i];
|
||||
}
|
||||
|
||||
if (M_CheckParm("-resetchallengegrid"))
|
||||
{
|
||||
gamedata->challengegridwidth = 0;
|
||||
if (gamedata->challengegrid)
|
||||
{
|
||||
Z_Free(gamedata->challengegrid);
|
||||
gamedata->challengegrid = nullptr;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!M_CheckParm("-resetchallengegrid"))
|
||||
{
|
||||
gamedata->challengegridwidth = std::max(js.challengegrid.width, (uint32_t)0);
|
||||
if (gamedata->challengegrid)
|
||||
{
|
||||
Z_Free(gamedata->challengegrid);
|
||||
gamedata->challengegrid = nullptr;
|
||||
}
|
||||
if (gamedata->challengegridwidth)
|
||||
{
|
||||
gamedata->challengegrid = static_cast<uint16_t*>(Z_Malloc(
|
||||
|
|
@ -549,10 +535,6 @@ void srb2::load_ng_gamedata()
|
|||
|
||||
M_SanitiseChallengeGrid();
|
||||
}
|
||||
else
|
||||
{
|
||||
gamedata->challengegrid = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
gamedata->timesBeaten = js.timesBeaten;
|
||||
|
|
@ -666,10 +648,6 @@ void srb2::load_ng_gamedata()
|
|||
|
||||
gamedata->gotspraycans = 0;
|
||||
gamedata->numspraycans = js.spraycans.size();
|
||||
if (gamedata->spraycans)
|
||||
{
|
||||
Z_Free(gamedata->spraycans);
|
||||
}
|
||||
if (gamedata->numspraycans)
|
||||
{
|
||||
gamedata->spraycans = static_cast<candata_t*>(Z_Malloc(
|
||||
|
|
@ -731,10 +709,6 @@ void srb2::load_ng_gamedata()
|
|||
gamedata->gotspraycans++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gamedata->spraycans = nullptr;
|
||||
}
|
||||
|
||||
for (auto& cuppair : js.cups)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue