- fixed: plane heighr calculations for Floor_Lower/RaiseByValue should be done at a point that's actually near the affected sector, not at (0,0), otherwise there's a risk of fixed point overflow.

This commit is contained in:
Christoph Oelckers 2016-01-27 11:01:38 +01:00
parent c3047f448e
commit 4eb38f0381

View file

@ -342,16 +342,16 @@ bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
floor->m_Speed = height;
case DFloor::floorLowerByValue:
floor->m_Direction = -1;
newheight = sec->floorplane.ZatPoint (0, 0) - height;
floor->m_FloorDestDist = sec->floorplane.PointToDist (0, 0, newheight);
newheight = sec->floorplane.ZatPoint (sec->soundorg[0], sec->soundorg[1]) - height;
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->soundorg[0], sec->soundorg[1], newheight);
break;
case DFloor::floorRaiseInstant:
floor->m_Speed = height;
case DFloor::floorRaiseByValue:
floor->m_Direction = 1;
newheight = sec->floorplane.ZatPoint (0, 0) + height;
floor->m_FloorDestDist = sec->floorplane.PointToDist (0, 0, newheight);
newheight = sec->floorplane.ZatPoint (sec->soundorg[0], sec->soundorg[1]) + height;
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->soundorg[0], sec->soundorg[1], newheight);
break;
case DFloor::floorMoveToValue: