diff --git a/src/battle_anim_sound_tasks.c b/src/battle_anim_sound_tasks.c index bd4638224f..c4ad988a0b 100644 --- a/src/battle_anim_sound_tasks.c +++ b/src/battle_anim_sound_tasks.c @@ -167,10 +167,7 @@ void SoundTask_PlayCryHighPitch(u8 taskId) return; } - if (GetBattlerSide(battlerId) != B_SIDE_PLAYER) - species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); - else - species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); + species = (GetIllusionMonSpecies(battlerId) != SPECIES_NONE) ? GetIllusionMonSpecies(battlerId) : gAnimBattlerSpecies[battlerId]; } if (species != SPECIES_NONE) @@ -215,10 +212,7 @@ void SoundTask_PlayDoubleCry(u8 taskId) return; } - if (GetBattlerSide(battlerId) != B_SIDE_PLAYER) - species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); - else - species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); + species = (GetIllusionMonSpecies(battlerId) != SPECIES_NONE) ? GetIllusionMonSpecies(battlerId) : gAnimBattlerSpecies[battlerId]; } gTasks[taskId].data[0] = gBattleAnimArgs[1]; @@ -285,7 +279,8 @@ void SoundTask_WaitForCry(u8 taskId) void SoundTask_PlayNormalCry(u8 taskId) { - PlayCry_ByMode(gBattleMons[gBattleAnimAttacker].species, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER), CRY_MODE_NORMAL); + u16 species = (GetIllusionMonSpecies(gBattleAnimAttacker) != SPECIES_NONE) ? GetIllusionMonSpecies(gBattleAnimAttacker) : gAnimBattlerSpecies[gBattleAnimAttacker]; + PlayCry_ByMode(species, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER), CRY_MODE_NORMAL); gTasks[taskId].func = SoundTask_WaitForCry; } @@ -305,7 +300,7 @@ void SoundTask_PlayCryWithEcho(u8 taskId) if (IsContest()) species = gContestResources->moveAnim->species; else - species = gAnimBattlerSpecies[gBattleAnimAttacker]; + species = (GetIllusionMonSpecies(gBattleAnimAttacker) != SPECIES_NONE) ? GetIllusionMonSpecies(gBattleAnimAttacker) : gAnimBattlerSpecies[gBattleAnimAttacker]; gTasks[taskId].tSpecies = species; gTasks[taskId].tPan = pan;