From eaf943e14c5d6f7b09c0c547a9395b8731d246d3 Mon Sep 17 00:00:00 2001 From: Mumble <171087428+frutescens@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:57:20 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com> --- src/ui/target-select-ui-handler.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ui/target-select-ui-handler.ts b/src/ui/target-select-ui-handler.ts index be3c763dcf7..249ae7b8b01 100644 --- a/src/ui/target-select-ui-handler.ts +++ b/src/ui/target-select-ui-handler.ts @@ -65,16 +65,15 @@ export default class TargetSelectUiHandler extends UiHandler { } /** - * Determines what value to assign the main cursor on previous history or the user's status + * Determines what value to assign the main cursor based on the previous turn's target or the user's status * @param cursorN the cursor associated with the user's field index * @param user the Pokemon using the move */ resetCursor(cursorN: number, user: Pokemon): void { if (!Utils.isNullOrUndefined(cursorN)) { if ([ BattlerIndex.PLAYER, BattlerIndex.PLAYER_2 ].includes(cursorN) || user.battleSummonData.waveTurnCount === 1) { - this.cursor = cursorN = -1; - } else if (user.battleSummonData.waveTurnCount > 1) { - this.cursor = cursorN; + // Reset cursor on the first turn of a fight or if an ally was targeted last turn + cursorN = -1; } } this.setCursor(this.targets.includes(cursorN) ? cursorN : this.targets[0]);