From b2a6512981b98840c4068588a13c421699931f52 Mon Sep 17 00:00:00 2001 From: yqco Date: Tue, 9 Aug 2016 02:11:13 -0600 Subject: [PATCH 1/2] Fix partial initialization in ACS PickActor function --- src/p_map.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_map.cpp b/src/p_map.cpp index e7aceba78..ec9fea20a 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4439,6 +4439,9 @@ AActor *P_LinePickActor(AActor *t1, DAngle angle, double distance, DAngle pitch, TData.Caller = t1; TData.hitGhosts = true; + TData.MThruSpecies = false; + TData.ThruActors = false; + TData.ThruSpecies = false; if (Trace(t1->PosAtZ(shootz), t1->Sector, direction, distance, actorMask, wallMask, t1, trace, TRACE_NoSky | TRACE_PortalRestrict, CheckForActor, &TData)) From 6b27d0c3ba5ae3cdb24ab621ef2b7c97d6e9418e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 9 Aug 2016 15:11:11 +0200 Subject: [PATCH 2/2] - fixed: FPolyObj::RecalcActorFloorCeil altered the floorz of all actors in the same blockmap block as the polyobject, even when they were nowhere near its bounding box. This fix is still incomplete, it should really discard everything outside the polyobject, not outside its bounding box, but at least it eliminates the most severe occurences of dislocated items. --- src/po_man.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/po_man.cpp b/src/po_man.cpp index 001f308f1..e449e0d67 100644 --- a/src/po_man.cpp +++ b/src/po_man.cpp @@ -1327,6 +1327,17 @@ void FPolyObj::RecalcActorFloorCeil(FBoundingBox bounds) const while ((actor = it.Next()) != NULL) { + // skip everything outside the bounding box. + if (actor->X() + actor->radius <= bounds.Left() || + actor->X() - actor->radius >= bounds.Right() || + actor->Y() + actor->radius <= bounds.Bottom() || + actor->Y() - actor->radius >= bounds.Top()) + { + continue; + } + // Todo: Be a little more thorough with what gets altered here + // because this can dislocate a lot of items that were spawned on + // the lower side of a sector boundary. P_FindFloorCeiling(actor); } }