I_Error on failed challengegrid malloc

This commit is contained in:
toaster 2022-12-01 16:57:30 +00:00
parent 1391cbe01e
commit 8dc2b6bf81

View file

@ -107,6 +107,11 @@ void M_PopulateChallengeGrid(void)
(gamedata->challengegridwidth * CHALLENGEGRIDHEIGHT * sizeof(UINT8)),
PU_STATIC, NULL);
if (!gamedata->challengegrid)
{
I_Error("M_PopulateChallengeGrid: was not able to allocate grid");
}
memset(gamedata->challengegrid,
MAXUNLOCKABLES,
(gamedata->challengegridwidth * CHALLENGEGRIDHEIGHT * sizeof(UINT8)));