diff --git a/source/common/objects/dobjgc.cpp b/source/common/objects/dobjgc.cpp index d388e4836b..c2fe53bbe0 100644 --- a/source/common/objects/dobjgc.cpp +++ b/source/common/objects/dobjgc.cpp @@ -184,8 +184,15 @@ static cycle_t GCTime; // Track time spent in GC // //========================================================================== +TArray allObjects; + void CheckGC() { + allObjects.Clear(); + for (auto obj = GC::Root; obj; obj = obj->ObjNext) + { + allObjects.Push(obj); + } AllocHistory.AddAlloc(RunningAllocBytes); RunningAllocBytes = 0; if (State > GCS_Pause || AllocBytes >= Threshold) @@ -219,6 +226,7 @@ void SetThreshold() size_t PropagateMark() { DObject *obj = Gray; + assert(!obj || allObjects.Find(obj) < allObjects.Size()); assert(obj->IsGray()); obj->Gray2Black(); Gray = obj->GCNext; @@ -319,6 +327,8 @@ void Mark(DObject **obj) { DObject *lobj = *obj; + assert(!lobj || allObjects.Find(lobj) < allObjects.Size()); + //assert(lobj == nullptr || !(lobj->ObjectFlags & OF_Released)); if (lobj != nullptr && !(lobj->ObjectFlags & OF_Released)) { diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 371fce386c..7be3cac504 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -1215,7 +1215,7 @@ static void movement(DDukePlayer* const p, ESyncBits actions, sectortype* psect, if (pact->getOffsetZ() + p->vel.Z >= floorz - i) // hit the ground { S_StopSound(DUKE_SCREAM, pact); - if (!p->insector() || p->cursector->lotag != 1) + if (!p->insector() || p->cursector->lotag != ST_1_ABOVE_WATER) { if (isRRRA()) p->MotoOnGround = 1; if ((p->falling_counter > 62 || (isRRRA() && p->falling_counter > 2 && p->insector() && p->cursector->lotag == 802)) && !ud.god)