From 70676dadca6790a846a453864b9b4e48ebb65c49 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Mon, 18 Nov 2024 03:42:40 -0300 Subject: [PATCH] fix zoness boss UB --- src/overlays/ovl_i3/fox_zo.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/overlays/ovl_i3/fox_zo.c b/src/overlays/ovl_i3/fox_zo.c index dde6aa3e..ed635829 100644 --- a/src/overlays/ovl_i3/fox_zo.c +++ b/src/overlays/ovl_i3/fox_zo.c @@ -3269,19 +3269,13 @@ void Zoness_801986FC(ZoSarumarine* this, s32 arg1, f32 xOff, f32 yOff, f32 zOff, } } +#ifndef AVOID_UB + // @Bug: checking out of bounds + // If this passes the boss kills himself. if (i >= ARRAY_COUNT(gActors)) { - actor245 = NULL; - } - - if (actor245 != NULL) { actor245->obj.status = OBJ_FREE; } - - if (i < ARRAY_COUNT(gActors)) { - if (actor245 != NULL) { - actor245->obj.status = OBJ_FREE; - } - } +#endif } void Zoness_801989FC(ZoSarumarine* this) {