From d633e8afc1c36aafc8a692d9661f97832235e301 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 25 May 2017 10:41:06 +0300 Subject: [PATCH] Fixed sector iteration with Floor_Stop and Ceiling_Stop action specials https://forum.zdoom.org/viewtopic.php?t=56582 --- src/p_ceiling.cpp | 3 ++- src/p_floor.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_ceiling.cpp b/src/p_ceiling.cpp index fcd2a54876..fb324b54a3 100644 --- a/src/p_ceiling.cpp +++ b/src/p_ceiling.cpp @@ -593,8 +593,9 @@ bool EV_CeilingCrushStop (int tag, bool remove) bool EV_StopCeiling(int tag, line_t *line) { + int sec; FSectorTagIterator it(tag, line); - while (int sec = it.Next()) + while ((sec = it.Next()) >= 0) { if (level.sectors[sec].ceilingdata) { diff --git a/src/p_floor.cpp b/src/p_floor.cpp index 63ebdc4af6..d0b6cb0773 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -570,8 +570,9 @@ bool EV_FloorCrushStop (int tag, line_t *line) // same as above but stops any floor mover that was active on the given sector. bool EV_StopFloor(int tag, line_t *line) { + int sec; FSectorTagIterator it(tag, line); - while (int sec = it.Next()) + while ((sec = it.Next()) >= 0) { if (level.sectors[sec].floordata) {