fix zoness boss UB

This commit is contained in:
Sonic Dreamcaster 2024-11-18 03:42:40 -03:00
parent d7f59ea5e2
commit 70676dadca

View File

@ -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)) { if (i >= ARRAY_COUNT(gActors)) {
actor245 = NULL;
}
if (actor245 != NULL) {
actor245->obj.status = OBJ_FREE; actor245->obj.status = OBJ_FREE;
} }
#endif
if (i < ARRAY_COUNT(gActors)) {
if (actor245 != NULL) {
actor245->obj.status = OBJ_FREE;
}
}
} }
void Zoness_801989FC(ZoSarumarine* this) { void Zoness_801989FC(ZoSarumarine* this) {