From fc85cb03472ed2fdac45e6a00ba65abff20fddb3 Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 24 Nov 2023 15:05:11 -0800 Subject: [PATCH] Fix crash in cur_obj_detect_steep_floor --- src/game/object_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index 227ba4fe..8ca352ac 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -2080,7 +2080,7 @@ s32 cur_obj_detect_steep_floor(s16 steepAngleDegrees) { if (intendedFloorHeight < gLevelValues.floorLowerLimitMisc) { o->oWallAngle = o->oMoveAngleYaw + 0x8000; return 2; - } else if (intendedFloor->normal.y < steepNormalY && deltaFloorHeight > 0 + } else if (intendedFloor && intendedFloor->normal.y < steepNormalY && deltaFloorHeight > 0 && intendedFloorHeight > o->oPosY) { o->oWallAngle = atan2s(intendedFloor->normal.z, intendedFloor->normal.x); return 1;