From 61739b408669f207fcc10a9df1156cbfca6e3d74 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Aug 2021 18:00:14 +0200 Subject: [PATCH] - fixed BlockThingsIterator to not reset its list of processed actors when traversing portals. --- src/playsim/p_maputl.cpp | 7 ++++--- src/playsim/p_maputl.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/playsim/p_maputl.cpp b/src/playsim/p_maputl.cpp index 68ab182e3..6cd8de850 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 e293f317f..0c93ab445 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); } };