No need to NULL check statically declared array entries.

This commit is contained in:
Daniel Svensson 2023-12-22 10:52:19 +01:00
parent c7eb4fb3b0
commit bdb5df93a9
3 changed files with 3 additions and 4 deletions

View file

@ -2553,7 +2553,6 @@ void Key_Unbindall_f (void)
int i;
for (i=0 ; i<K_MAX ; i++)
if (keybindings[i])
Key_SetBinding (i, ~0, NULL, Cmd_ExecLevel);
}

View file

@ -6759,7 +6759,7 @@ static void QCBUILTIN PF_resourcestatus(pubprogfuncs_t *prinst, struct globalvar
return;
case RESTYPE_SOUND:
sfx = NULL;
for (idx=1 ; idx<MAX_PRECACHE_SOUNDS && cl.sound_name[idx] ; idx++)
for (idx=1 ; idx<MAX_PRECACHE_SOUNDS; idx++)
{
if (!strcmp(cl.sound_name[idx], resname))
{

View file

@ -3052,7 +3052,7 @@ void Sbar_Draw (playerview_t *pv)
R2D_ImageColours(1, 1, 1, 1);
if (*cl.q2statusbar)
Sbar_ExecuteLayoutString(cl.q2statusbar, seat);
if (*cl.q2layout && (cl.q2frame.playerstate[seat].stats[Q2STAT_LAYOUTS] & 1))
if (cl.q2frame.playerstate[seat].stats[Q2STAT_LAYOUTS] & 1)
Sbar_ExecuteLayoutString(cl.q2layout[seat], seat);
if (cl.q2frame.playerstate[seat].stats[Q2STAT_LAYOUTS] & 2)
Sbar_Q2DrawInventory(seat);