From b13f104fde45ae2b88533dd1778f7f1d8b685aca Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 20 Apr 2025 15:21:39 +0200 Subject: [PATCH] fix P_CameraLineOpening lel this was always botched --- src/p_maputl.c | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index a88545135..7b748c22e 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -294,50 +294,34 @@ void P_CameraLineOpening(line_t *linedef) // If you can see through it, why not move the camera through it too? if (front->camsec >= 0) { - frontfloor = sectors[front->camsec].floorheight; - frontceiling = sectors[front->camsec].ceilingheight; - if (sectors[front->camsec].f_slope) - frontfloor = P_GetZAt(sectors[front->camsec].f_slope, camera[0].x, camera[0].y); - if (sectors[front->camsec].c_slope) - frontceiling = P_GetZAt(sectors[front->camsec].c_slope, camera[0].x, camera[0].y); + frontfloor = P_GetSectorFloorZAt (§ors[front->camsec], camera[0].x, camera[0].y); + frontceiling = P_GetSectorCeilingZAt(§ors[front->camsec], camera[0].x, camera[0].y); } else if (front->heightsec >= 0) { - frontfloor = sectors[front->heightsec].floorheight; - frontceiling = sectors[front->heightsec].ceilingheight; - if (sectors[front->heightsec].f_slope) - frontfloor = P_GetZAt(sectors[front->heightsec].f_slope, camera[0].x, camera[0].y); - if (sectors[front->heightsec].c_slope) - frontceiling = P_GetZAt(sectors[front->heightsec].c_slope, camera[0].x, camera[0].y); + frontfloor = P_GetSectorFloorZAt (§ors[front->heightsec], camera[0].x, camera[0].y); + frontceiling = P_GetSectorCeilingZAt(§ors[front->heightsec], camera[0].x, camera[0].y); } else { - frontfloor = P_CameraGetFloorZ(mapcampointer, front, tmx, tmy, linedef); + frontfloor = P_CameraGetFloorZ (mapcampointer, front, tmx, tmy, linedef); frontceiling = P_CameraGetCeilingZ(mapcampointer, front, tmx, tmy, linedef); } if (back->camsec >= 0) { - backfloor = sectors[back->camsec].floorheight; - backceiling = sectors[back->camsec].ceilingheight; - if (sectors[back->camsec].f_slope) - frontfloor = P_GetZAt(sectors[back->camsec].f_slope, camera[0].x, camera[0].y); - if (sectors[back->camsec].c_slope) - frontceiling = P_GetZAt(sectors[back->camsec].c_slope, camera[0].x, camera[0].y); + backfloor = P_GetSectorFloorZAt (§ors[back->camsec], camera[0].x, camera[0].y); + backceiling = P_GetSectorCeilingZAt(§ors[back->camsec], camera[0].x, camera[0].y); } else if (back->heightsec >= 0) { - backfloor = sectors[back->heightsec].floorheight; - backceiling = sectors[back->heightsec].ceilingheight; - if (sectors[back->heightsec].f_slope) - frontfloor = P_GetZAt(sectors[back->heightsec].f_slope, camera[0].x, camera[0].y); - if (sectors[back->heightsec].c_slope) - frontceiling = P_GetZAt(sectors[back->heightsec].c_slope, camera[0].x, camera[0].y); + backfloor = P_GetSectorFloorZAt (§ors[back->heightsec], camera[0].x, camera[0].y); + backceiling = P_GetSectorCeilingZAt(§ors[back->heightsec], camera[0].x, camera[0].y); } else { - backfloor = P_CameraGetFloorZ(mapcampointer, back, tmx, tmy, linedef); + backfloor = P_CameraGetFloorZ(mapcampointer, back, tmx, tmy, linedef); backceiling = P_CameraGetCeilingZ(mapcampointer, back, tmx, tmy, linedef); }