diff --git a/src/playsim/p_maputl.cpp b/src/playsim/p_maputl.cpp index 68ab182e3b..6cd8de8505 100644 --- a/src/playsim/p_maputl.cpp +++ b/src/playsim/p_maputl.cpp @@ -910,13 +910,13 @@ FBlockThingsIterator::FBlockThingsIterator(FLevelLocals *l, int _minx, int _miny Reset(); } -void FBlockThingsIterator::init(const FBoundingBox &box) +void FBlockThingsIterator::init(const FBoundingBox &box, bool clearhash) { maxy = Level->blockmap.GetBlockY(box.Top()); miny = Level->blockmap.GetBlockY(box.Bottom()); maxx = Level->blockmap.GetBlockX(box.Right()); minx = Level->blockmap.GetBlockX(box.Left()); - ClearHash(); + if (clearhash) ClearHash(); Reset(); } @@ -1139,7 +1139,7 @@ void FMultiBlockThingsIterator::startIteratorForGroup(int group) offset.X += checkpoint.X; offset.Y += checkpoint.Y; bbox.setBox(offset.X, offset.Y, checkpoint.Z); - blockIterator.init(bbox); + blockIterator.init(bbox, false); } //=========================================================================== @@ -1153,6 +1153,7 @@ void FMultiBlockThingsIterator::Reset() index = -1; portalflags = 0; startIteratorForGroup(basegroup); + blockIterator.ClearHash(); } //=========================================================================== diff --git a/src/playsim/p_maputl.h b/src/playsim/p_maputl.h index e293f317fb..0c93ab4452 100644 --- a/src/playsim/p_maputl.h +++ b/src/playsim/p_maputl.h @@ -319,7 +319,7 @@ public: Level = l; init(box); } - void init(const FBoundingBox &box); + void init(const FBoundingBox &box, bool clearhash = true); AActor *Next(bool centeronly = false); void Reset() { StartBlock(minx, miny); } };