mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-02-03 00:33:55 +03:00
UB fix in Bolse's Event Handler update function
This commit is contained in:
parent
79a05aa6dc
commit
af6164e353
@ -203,7 +203,7 @@ void Bolse_SpawnEnemies(ActorEvent* this, s32 count) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Bolse_UpdateEventHandler(ActorEvent* this) {
|
void Bolse_UpdateEventHandler(ActorEvent* this) {
|
||||||
s32 i;
|
s32 i = 0;
|
||||||
Player* player = &gPlayer[0];
|
Player* player = &gPlayer[0];
|
||||||
s32 pad;
|
s32 pad;
|
||||||
Actor* actor;
|
Actor* actor;
|
||||||
@ -352,7 +352,12 @@ void Bolse_UpdateEventHandler(ActorEvent* this) {
|
|||||||
case 10:
|
case 10:
|
||||||
if (gBosses[1].obj.status != 0) {
|
if (gBosses[1].obj.status != 0) {
|
||||||
if (fabsf(Math_SmoothStepToF(&gBosses[1].scale, 0.0f, 1.0f, 0.05f, 0.001f)) < 0.05f) {
|
if (fabsf(Math_SmoothStepToF(&gBosses[1].scale, 0.0f, 1.0f, 0.05f, 0.001f)) < 0.05f) {
|
||||||
|
// @bug: i is uninitialized and likely contains stack garbage.
|
||||||
|
#ifdef AVOID_UB
|
||||||
|
Object_Kill(&gBosses[1].obj, gBosses[1].sfxSource);
|
||||||
|
#else
|
||||||
Object_Kill(&gBosses[1].obj, gBosses[i].sfxSource);
|
Object_Kill(&gBosses[1].obj, gBosses[i].sfxSource);
|
||||||
|
#endif
|
||||||
gLight1R = 100;
|
gLight1R = 100;
|
||||||
gLight1G = 100;
|
gLight1G = 100;
|
||||||
gLight1B = 80;
|
gLight1B = 80;
|
||||||
|
Loading…
Reference in New Issue
Block a user