diff --git a/src/p_ceiling.cpp b/src/p_ceiling.cpp index fcd2a5487..fb324b54a 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 63ebdc4af..d0b6cb077 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) {