From c7ba1d15321531fe2d5ba01e6854760305e98f63 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 26 Feb 2016 18:11:12 +0000 Subject: [PATCH] Make sure target sector's lightlist is reset whenever FOF flags are changed. This fixes how removing certain flags (such as FF_EXISTS) from FOFs can cause HOMs on walls bordering their target sectors. Also fixes how the force-FOF-to-vanish linedef special can leave behind the FOF's shadow --- src/lua_maplib.c | 6 +++++- src/p_spec.c | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 38920c223..16d05dacd 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1111,9 +1111,13 @@ static int ffloor_set(lua_State *L) case ffloor_bottompic: *ffloor->bottompic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; - case ffloor_flags: + case ffloor_flags: { + ffloortype_e oldflags = ffloor->flags; // store FOF's old flags ffloor->flags = luaL_checkinteger(L, 3); + if (ffloor->flags != oldflags) + ffloor->target->moved = true; // reset target sector's lightlist break; + } case ffloor_alpha: ffloor->alpha = (INT32)luaL_checkinteger(L, 3); break; diff --git a/src/p_spec.c b/src/p_spec.c index 81994d46c..2c471fa9e 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3039,6 +3039,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) INT16 foftag = (INT16)(sides[line->sidenum[0]].rowoffset>>FRACBITS); sector_t *sec; // Sector that the FOF is visible (or not visible) in ffloor_t *rover; // FOF to vanish/un-vanish + ffloortype_e oldflags; // store FOF's old flags for (secnum = -1; (secnum = P_FindSectorFromTag(sectag, secnum)) >= 0 ;) { @@ -3062,11 +3063,17 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) return; } + oldflags = rover->flags; + // Abracadabra! if (line->flags & ML_NOCLIMB) rover->flags |= FF_EXISTS; else rover->flags &= ~FF_EXISTS; + + // if flags changed, reset sector's light list + if (rover->flags != oldflags) + sec->moved = true; } } break;