Fix crash in cur_obj_detect_steep_floor

This commit is contained in:
MysterD 2023-11-24 15:05:11 -08:00 committed by Agent X
parent 5a98b00713
commit a0b3869711

View file

@ -2080,7 +2080,7 @@ s32 cur_obj_detect_steep_floor(s16 steepAngleDegrees) {
if (intendedFloorHeight < gLevelValues.floorLowerLimitMisc) { if (intendedFloorHeight < gLevelValues.floorLowerLimitMisc) {
o->oWallAngle = o->oMoveAngleYaw + 0x8000; o->oWallAngle = o->oMoveAngleYaw + 0x8000;
return 2; return 2;
} else if (intendedFloor->normal.y < steepNormalY && deltaFloorHeight > 0 } else if (intendedFloor && intendedFloor->normal.y < steepNormalY && deltaFloorHeight > 0
&& intendedFloorHeight > o->oPosY) { && intendedFloorHeight > o->oPosY) {
o->oWallAngle = atan2s(intendedFloor->normal.z, intendedFloor->normal.x); o->oWallAngle = atan2s(intendedFloor->normal.z, intendedFloor->normal.x);
return 1; return 1;