Clarity in if statement

This commit is contained in:
Christopher Schmidt 2024-09-15 20:03:55 -04:00
parent 6c656d81de
commit 68ecc3dc19
1 changed files with 2 additions and 2 deletions

View File

@ -91,11 +91,11 @@ export class CommandPhase extends FieldPhase {
playerPokemon.trySelectMove(cursor, args[0] as boolean) ||
(useStruggle = cursor > -1 && !playerPokemon.getMoveset().filter(m => m?.isUsable(playerPokemon)).length)) {
const turnMove: TurnMove | undefined = args.length === 1 ? (args[0] as TurnMove) : undefined;
/* THIS NEEDS FURTHER TESTING */
let moveId: Moves;
if (useStruggle) {
moveId = Moves.STRUGGLE;
} else if (turnMove) {
} else if (turnMove !== undefined) {
moveId = turnMove.move;
} else if (cursor > -1) {
moveId = playerPokemon.getMoveset()[cursor]!.moveId;