From 35d0ea5ff5ac72751a6c01fe8b451c08cd9ec98d Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 8 Dec 2018 00:09:39 +0100 Subject: [PATCH] Fix moves hitting all 3 pokemon --- src/battle_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/battle_main.c b/src/battle_main.c index 4ceae5fae3..585713b503 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5605,6 +5605,16 @@ static void HandleAction_UseMove(void) gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); } } + else if (gBattleMoves[gChosenMove].target & MOVE_TARGET_FOES_AND_ALLY) + { + for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) + { + if (gBattlerTarget == gBattlerAttacker) + continue; + if (!(gAbsentBattlerFlags & gBitTable[gBattlerTarget])) + break; + } + } else { gBattlerTarget = *(gBattleStruct->moveTarget + gBattlerAttacker); @@ -5666,6 +5676,17 @@ static void HandleAction_UseMove(void) else gBattlerTarget = gBattlerAttacker; } + else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE + && gBattleMoves[gChosenMove].target == MOVE_TARGET_FOES_AND_ALLY) + { + for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) + { + if (gBattlerTarget == gBattlerAttacker) + continue; + if (!(gAbsentBattlerFlags & gBitTable[gBattlerTarget])) + break; + } + } else { gBattlerTarget = *(gBattleStruct->moveTarget + gBattlerAttacker);