From b81876698fa67bcd426f2403ea4509a41e0363ce Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 4 Jul 2016 22:36:27 +0200 Subject: [PATCH] - changed P_ChangeSector so that for bridges it only keeps the floorz and ceilingz of the spawn position. This is necessary to prevent moving sectors from altering the bridge's z-position. The bridge should remain at its current z, even if the sector change would cause floorz or ceilingz to be changed in a way that would make P_ZMovement adjust the bridge. --- src/p_map.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index cf7655917c..2fe41b17b6 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -5466,14 +5466,25 @@ bool P_AdjustFloorCeil(AActor *thing, FChangePosition *cpos) } bool isgood = P_CheckPosition(thing, thing->Pos(), tm); - thing->floorz = tm.floorz; - thing->ceilingz = tm.ceilingz; - thing->dropoffz = tm.dropoffz; // killough 11/98: remember dropoffs - thing->floorpic = tm.floorpic; - thing->floorterrain = tm.floorterrain; - thing->floorsector = tm.floorsector; - thing->ceilingpic = tm.ceilingpic; - thing->ceilingsector = tm.ceilingsector; + if (!(thing->flags4 & MF4_ACTLIKEBRIDGE)) + { + thing->floorz = tm.floorz; + thing->ceilingz = tm.ceilingz; + thing->dropoffz = tm.dropoffz; // killough 11/98: remember dropoffs + thing->floorpic = tm.floorpic; + thing->floorterrain = tm.floorterrain; + thing->floorsector = tm.floorsector; + thing->ceilingpic = tm.ceilingpic; + thing->ceilingsector = tm.ceilingsector; + } + else + { + // Bridges only keep the info at their spawn position + // This is necessary to prevent moving sectors from altering the bridge's z-position. + // The bridge should remain at its current z, even if the sector change would cause + // floorz or ceilingz to be changed in a way that would make P_ZMovement adjust the bridge. + P_FindFloorCeiling(thing, FFCF_ONLYSPAWNPOS); + } // restore the PASSMOBJ flag but leave the other flags alone. thing->flags2 = (thing->flags2 & ~MF2_PASSMOBJ) | flags2;