mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 17:22:12 +00:00
More NULL failsafes
This commit is contained in:
parent
e95cd0f962
commit
d85019b4e4
1 changed files with 13 additions and 1 deletions
14
src/p_spec.c
14
src/p_spec.c
|
@ -3396,9 +3396,11 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
}
|
||||
else
|
||||
Z_Free(exc);
|
||||
|
||||
sectors[secnum].extra_colormap = source_exc;
|
||||
}
|
||||
else
|
||||
source_exc = exc;
|
||||
source_exc = exc ? exc : R_GetDefaultColormap();
|
||||
|
||||
if (line->flags & ML_EFFECT3) // relative calc
|
||||
{
|
||||
|
@ -7510,6 +7512,16 @@ void T_FadeColormap(fadecolormap_t *d)
|
|||
INT16 cr, cg, cb, ca, fadestart, fadeend, fog;
|
||||
INT32 rgba, fadergba;
|
||||
|
||||
// NULL failsafes (or intentionally set to signify default)
|
||||
if (!d->sector->extra_colormap)
|
||||
d->sector->extra_colormap = R_GetDefaultColormap();
|
||||
|
||||
if (!d->source_exc)
|
||||
d->source_exc = R_GetDefaultColormap();
|
||||
|
||||
if (!d->dest_exc)
|
||||
d->dest_exc = R_GetDefaultColormap();
|
||||
|
||||
// For each var (rgba + fadergba + params = 11 vars), we apply
|
||||
// percentage fading: currentval = sourceval + (delta * percent of duration elapsed)
|
||||
// delta is negative when fading out (destval is lower)
|
||||
|
|
Loading…
Reference in a new issue