summaryrefslogtreecommitdiff
path: root/src/battle_gfx_sfx_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/battle_gfx_sfx_util.c')
-rw-r--r--src/battle_gfx_sfx_util.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c
index db172b4a1..06c6aaaa9 100644
--- a/src/battle_gfx_sfx_util.c
+++ b/src/battle_gfx_sfx_util.c
@@ -296,15 +296,18 @@ bool8 IsBattleSEPlaying(u8 battlerId)
if (IsSEPlaying())
{
- ++gBattleSpritesDataPtr->healthBoxesData[battlerId].field_8;
- if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_8 < 30)
+ ++gBattleSpritesDataPtr->healthBoxesData[battlerId].soundTimer;
+ // UB: Uses gActiveBattler instead of battlerId.
+ // In practice, this is never a problem, as this routine
+ // is only ever passed gActiveBattler.
+ if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].soundTimer < 30)
return TRUE;
m4aMPlayStop(&gMPlayInfo_SE1);
m4aMPlayStop(&gMPlayInfo_SE2);
}
if (zero == 0)
{
- gBattleSpritesDataPtr->healthBoxesData[battlerId].field_8 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[battlerId].soundTimer = 0;
return FALSE;
}
else