diff --git a/src/maploader/polyobjects.cpp b/src/maploader/polyobjects.cpp index 1ff264712..3c0a567ad 100644 --- a/src/maploader/polyobjects.cpp +++ b/src/maploader/polyobjects.cpp @@ -352,6 +352,7 @@ void MapLoader::PO_Init (void) InitSideLists (); Level->Polyobjects.Resize(NumPolyobjs); + for (auto &po : Level->Polyobjects) po.Level = Level; // must be done before the init loop below. polyIndex = 0; // index polyobj number // Find the startSpot points, and spawn each polyobj diff --git a/src/p_maputl.h b/src/p_maputl.h index 99a8a8a04..5a65c27d3 100644 --- a/src/p_maputl.h +++ b/src/p_maputl.h @@ -312,8 +312,9 @@ class FBlockThingsIterator public: FBlockThingsIterator(FLevelLocals *Level, int minx, int miny, int maxx, int maxy); - FBlockThingsIterator(FLevelLocals *Level, const FBoundingBox &box) + FBlockThingsIterator(FLevelLocals *l, const FBoundingBox &box) { + Level = l; init(box); } void init(const FBoundingBox &box);