From 2a2198ade1cd849712d212d2955a555bdccf6d06 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 3 Feb 2021 17:18:37 -0500 Subject: [PATCH] Remove MF_NOSECTOR from MT_WAYPOINT, so the linedef executor can search through sector thinglist for them. --- src/info.c | 2 +- src/p_spec.c | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/info.c b/src/info.c index c6f082a5c..73666e730 100644 --- a/src/info.c +++ b/src/info.c @@ -24278,7 +24278,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags S_NULL // raisestate }, diff --git a/src/p_spec.c b/src/p_spec.c index 425c4ed27..1973e8708 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3907,10 +3907,11 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) case 499: // Enable/Disable Waypoints in Tagged Sectors { sector_t *sec; - mobj_t *waypointmobj; + mobj_t *thing; if (waypointcap == NULL) { + // No point in trying at all if no waypoints exist. break; } @@ -3918,21 +3919,17 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) { sec = sectors + secnum; - // Needs to do this instead of simply iterating through sector thing list because they have MF_NOSECTOR. - // Maybe it'd be OK to remove, but I'd like to play it safe. - for (waypointmobj = waypointcap; waypointmobj != NULL; waypointmobj = waypointmobj->tracer) + for (thing = sec->thinglist; thing; thing = thing->snext) { - sector_t *waypointSector = R_PointInSubsector(waypointmobj->x, waypointmobj->y)->sector; - - if (waypointSector == sec) + if (thing->type == MT_WAYPOINT) { if (line->flags & ML_NOCLIMB) { - waypointmobj->extravalue1 = 1; + thing->extravalue1 = 1; } else { - waypointmobj->extravalue1 = 0; + thing->extravalue1 = 0; } } }