G_UpdateRecords: Do not destroy existing record data if you experience other types of modeattacking on the same map

Should not have been possible to trigger with current menu setup, but was a hypothetical danger
This commit is contained in:
toaster 2023-10-06 18:47:55 +01:00
parent e96bae393c
commit 8f1bea71de

View file

@ -529,20 +529,12 @@ void G_UpdateRecords(void)
&& (time < UINT32_MAX)) // DNF && (time < UINT32_MAX)) // DNF
mapheaderinfo[gamemap-1]->records.time = time; mapheaderinfo[gamemap-1]->records.time = time;
} }
else
{
mapheaderinfo[gamemap-1]->records.time = 0;
}
if (modeattacking & ATTACKING_LAP) if (modeattacking & ATTACKING_LAP)
{ {
if ((mapheaderinfo[gamemap-1]->records.lap == 0) || (bestlap < mapheaderinfo[gamemap-1]->records.lap)) if ((mapheaderinfo[gamemap-1]->records.lap == 0) || (bestlap < mapheaderinfo[gamemap-1]->records.lap))
mapheaderinfo[gamemap-1]->records.lap = bestlap; mapheaderinfo[gamemap-1]->records.lap = bestlap;
} }
else
{
mapheaderinfo[gamemap-1]->records.lap = 0;
}
// Check emblems when level data is updated // Check emblems when level data is updated
if ((earnedEmblems = M_CheckLevelEmblems())) if ((earnedEmblems = M_CheckLevelEmblems()))