Fix Zones boss UB

This commit is contained in:
Alejandro Javier Asenjo Nitti 2024-11-18 03:27:21 -03:00
parent 611e14e977
commit 561f6a76d9
2 changed files with 12 additions and 5 deletions

View File

@ -302,13 +302,21 @@ void Spawner_ObjKill(void) {
}
// Use this function to add code that eases your documentation work!
Spawner_Playground(void) {
void Spawner_Playground(void) {
Player* player = &gPlayer[0];
player->mercyTimer = 100;
gLaserStrength[0] = 2;
gBombCount[0] = 9;
gLifeCount[0] = 9;
#if 0
if (gControllerPress[0].button & L_JPAD) {
gArwingSpeed -= 50;
} else if (gControllerPress[0].button & R_JPAD) {
gArwingSpeed += 50;
}
#endif
}
void Spawner(void) {

View File

@ -3271,14 +3271,13 @@ void Zoness_801986FC(ZoSarumarine* this, s32 arg1, f32 xOff, f32 yOff, f32 zOff,
}
}
#ifdef AVOID_UB
if (i < ARRAY_COUNT(gActors)) {
#else
#ifndef AVOID_UB
// @Bug: checking out of bounds
// If this passes the boss kills himself.
if (i >= ARRAY_COUNT(gActors)) {
#endif
actor245->obj.status = OBJ_FREE;
}
#endif
}
void Zoness_801989FC(ZoSarumarine* this) {