- 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.
This commit is contained in:
Christoph Oelckers 2016-08-09 15:11:11 +02:00
parent b2a6512981
commit 6b27d0c3ba

View file

@ -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);
}
}