fixed the long-standing segfault, plus fixed a bug with the Dorim mission.

So, that segfault? Turns out there's a place where I forgot to check
if something was NULL before accessing it, which turned out to be
important because for some reason, gfx_textSprites[TS_RADIO] got
set to 32 at some point while gfx_messageBox remained NULL.

This may be indicative of a memory leak somewhere, but it's
also possible that maybe it was left-over from a previous mission
or something, which may have been what made it so hard to spot (that
would make the bug time-sensitive as well as context-sensitive). In
any case, at least the segfault is fixed now.
This commit is contained in:
Julie Marchant 2019-05-26 17:43:14 -04:00
parent 8ca4522ac9
commit ac44cbdf75
1 changed files with 2 additions and 1 deletions

View File

@ -1928,7 +1928,7 @@ static void game_doHud()
}
// Show the radio message if there is one
if (gfx_textSprites[TS_RADIO].life > 0)
if ((gfx_textSprites[TS_RADIO].life > 0) && (gfx_messageBox != NULL))
{
screen_blit(gfx_messageBox, (screen->w - gfx_messageBox->w) / 2, 50);
gfx_textSprites[TS_RADIO].life--;
@ -2222,6 +2222,7 @@ int game_mainLoop()
{
aliens[0].collectChance = 100;
aliens[0].collectType = P_ESCAPEPOD;
aliens[0].collectTypeOriginal = P_ESCAPEPOD;
}
// Some specifics for interception missions