From 382bfaf72faa1a662c130d06e7fbeee9dea9be5e Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 27 Aug 2025 09:01:25 +0200 Subject: [PATCH] make sure subsec gets initalised to smth --- src/p_mobj.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index f7bacb0a8..84406e094 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -572,7 +572,7 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t if (sector->f_slope) { fixed_t testx, testy; - static fixed_t oldtestx = 0, oldtesty = 0; + static fixed_t oldtestx = INT32_MIN, oldtesty = INT32_MIN; static subsector_t *subsec = NULL; pslope_t *slope = sector->f_slope; @@ -596,7 +596,7 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t testx += x; testy += y; - if (oldtestx != testx || oldtesty != testy) + if (subsec == NULL || oldtestx != testx || oldtesty != testy) subsec = R_PointInSubsector(testx, testy); oldtestx = testx; @@ -667,7 +667,7 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed if (sector->c_slope) { fixed_t testx, testy; - static fixed_t oldtestx = 0, oldtesty = 0; + static fixed_t oldtestx = INT32_MIN, oldtesty = INT32_MIN; static subsector_t *subsec = NULL; pslope_t *slope = sector->c_slope; @@ -691,7 +691,7 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed testx += x; testy += y; - if (oldtestx != testx || oldtesty != testy) + if (subsec == NULL || oldtestx != testx || oldtesty != testy) subsec = R_PointInSubsector(testx, testy); oldtestx = testx;