From 4eb38f03819e7534fd87d48cae5f65ffd58bad0d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 27 Jan 2016 11:01:38 +0100 Subject: [PATCH] - 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. --- src/p_floor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_floor.cpp b/src/p_floor.cpp index e3763e677a..013f0a78ff 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -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: