mirror of
https://github.com/sonicdcer/sf64.git
synced 2024-11-26 22:40:42 +00:00
Fix UB in HUD_ShieldGaugeBars_Draw
This commit is contained in:
parent
561f6a76d9
commit
db352e70f7
@ -267,8 +267,13 @@ void HUD_ShieldGaugeFrame_Draw(f32 xPos, f32 yPos, f32 xScale, f32 yScale) {
|
||||
}
|
||||
|
||||
void HUD_ShieldGaugeBars_Draw(f32 xPos, f32 yPos, f32 xScale, f32 yScale, f32 arg4) {
|
||||
#ifdef AVOID_UB
|
||||
TextureRect_CI8_2(&gMasterDisp, aShieldGaugeTex, aShieldGaugeTLUT, 48, 8, xPos, yPos, xScale, yScale, 48.0f * arg4,
|
||||
8.0f);
|
||||
#else
|
||||
TextureRect_CI8_2(&gMasterDisp, aShieldGaugeTex, aShieldGaugeTLUT, 48, 12, xPos, yPos, xScale, yScale, 48.0f * arg4,
|
||||
8.0f);
|
||||
#endif
|
||||
}
|
||||
|
||||
void HUD_BoostGaugeFrame_Draw(f32 xPos, f32 yPos, f32 xScale, f32 yScale) {
|
||||
|
@ -3273,7 +3273,7 @@ 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 this passes the boss kills himself, since gActors[60] overflows to gBosses[0].
|
||||
if (i >= ARRAY_COUNT(gActors)) {
|
||||
actor245->obj.status = OBJ_FREE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user