mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- 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.
This commit is contained in:
parent
0b93e9b897
commit
b81876698f
1 changed files with 19 additions and 8 deletions
|
@ -5466,6 +5466,8 @@ bool P_AdjustFloorCeil(AActor *thing, FChangePosition *cpos)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isgood = P_CheckPosition(thing, thing->Pos(), tm);
|
bool isgood = P_CheckPosition(thing, thing->Pos(), tm);
|
||||||
|
if (!(thing->flags4 & MF4_ACTLIKEBRIDGE))
|
||||||
|
{
|
||||||
thing->floorz = tm.floorz;
|
thing->floorz = tm.floorz;
|
||||||
thing->ceilingz = tm.ceilingz;
|
thing->ceilingz = tm.ceilingz;
|
||||||
thing->dropoffz = tm.dropoffz; // killough 11/98: remember dropoffs
|
thing->dropoffz = tm.dropoffz; // killough 11/98: remember dropoffs
|
||||||
|
@ -5474,6 +5476,15 @@ bool P_AdjustFloorCeil(AActor *thing, FChangePosition *cpos)
|
||||||
thing->floorsector = tm.floorsector;
|
thing->floorsector = tm.floorsector;
|
||||||
thing->ceilingpic = tm.ceilingpic;
|
thing->ceilingpic = tm.ceilingpic;
|
||||||
thing->ceilingsector = tm.ceilingsector;
|
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.
|
// restore the PASSMOBJ flag but leave the other flags alone.
|
||||||
thing->flags2 = (thing->flags2 & ~MF2_PASSMOBJ) | flags2;
|
thing->flags2 = (thing->flags2 & ~MF2_PASSMOBJ) | flags2;
|
||||||
|
|
Loading…
Reference in a new issue