mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-01-23 13:35:11 +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) {
|
||||
s32 i;
|
||||
s32 i = 0;
|
||||
Player* player = &gPlayer[0];
|
||||
s32 pad;
|
||||
Actor* actor;
|
||||
@ -352,7 +352,12 @@ void Bolse_UpdateEventHandler(ActorEvent* this) {
|
||||
case 10:
|
||||
if (gBosses[1].obj.status != 0) {
|
||||
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);
|
||||
#endif
|
||||
gLight1R = 100;
|
||||
gLight1G = 100;
|
||||
gLight1B = 80;
|
||||
|
Loading…
Reference in New Issue
Block a user