420: Allow Back Y Offset for timing parameter

This commit is contained in:
mazmazz 2018-09-12 21:32:12 -04:00
parent 36923ae7b0
commit 41fe080a68
1 changed files with 8 additions and 2 deletions

View File

@ -2779,8 +2779,14 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
case 420: // Fade light levels in tagged sectors to new value
P_FadeLight(line->tag,
(line->flags & ML_DONTPEGBOTTOM) ? max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, 255), 0) : line->frontsector->lightlevel,
(line->flags & ML_DONTPEGBOTTOM) ? max(sides[line->sidenum[0]].rowoffset>>FRACBITS, 0) : P_AproxDistance(line->dx, line->dy)>>FRACBITS,
(line->flags & ML_DONTPEGBOTTOM) ? max(sides[line->sidenum[0]].textureoffset>>FRACBITS, 0) : line->frontsector->lightlevel,
// failsafe: if user specifies Back Y Offset and NOT Front Y Offset, use the Back Offset
// to be consistent with other light and fade specials
(line->flags & ML_DONTPEGBOTTOM) ?
((line->sidenum[1] != 0xFFFF && !(sides[line->sidenum[0]].rowoffset>>FRACBITS)) ?
max(min(sides[line->sidenum[1]].rowoffset>>FRACBITS, 255), 0)
: max(min(sides[line->sidenum[0]].rowoffset>>FRACBITS, 255), 0))
: abs(P_AproxDistance(line->dx, line->dy))>>FRACBITS),
(line->flags & ML_EFFECT4));
break;