Merge branch 'v2-nametags-crash' into 'master'

Fix potentially NULL colormap on nametags upon joining a netgame

See merge request KartKrew/Kart!287
This commit is contained in:
Sal 2020-06-10 17:37:11 -04:00
commit 07cf9cddf1

View file

@ -10025,9 +10025,10 @@ static void K_drawKartNameTags(void)
{
bary += (vid.height - (BASEVIDHEIGHT * vid.dupy)) / 2;
}
V_DrawFill(barx, bary, barw, (3 * vid.dupy), colormap[31]|V_NOSCALESTART);
V_DrawFill(barx, bary + vid.dupy, barw, vid.dupy, colormap[0]|V_NOSCALESTART);
// Lat: 10/06/2020: colormap can be NULL on the frame you join a game, just arbitrarily use palette indexes 31 and 0 instead of whatever the colormap would give us instead to avoid crashes.
V_DrawFill(barx, bary, barw, (3 * vid.dupy), (colormap ? colormap[31] : 31)|V_NOSCALESTART);
V_DrawFill(barx, bary + vid.dupy, barw, vid.dupy, (colormap ? colormap[0] : 0)|V_NOSCALESTART);
// END DRAWFILL DUMBNESS
// Draw the stem