mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-29 12:40:58 +00:00
Merge branch 'fof-flag-change-hotfix' into 'next'
Fof flag change hotfix This fixes rendering issues caused by changing FOF flags mid-level via Lua or linedef type 445. Everything else that toggles FF_EXISTS already had this fix it turns out. Not sure if this is safe for master too, could someone check that for me? See merge request !53
This commit is contained in:
commit
4bb7143967
2 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue