diff --git a/calc.js b/calc.js index 26dd802..87332d2 100644 --- a/calc.js +++ b/calc.js @@ -1,5 +1,6 @@ import { calculate, + toID, Field, Generations, Move, @@ -266,11 +267,11 @@ function parseAndCalculate(line) { } // Pre-checking before the calculator throws unreadable errors. - if (!gen.species.get(attacker.toLowerCase())) + if (!gen.species.get(toID(attacker))) throw Error(`No species named ${attacker}`); - if (!gen.species.get(defender.toLowerCase())) + if (!gen.species.get(toID(defender))) throw Error(`No species named ${defender}`); - if (!gen.moves.get(move.toLowerCase())) throw Error(`No move named ${move}`); + if (!gen.moves.get(toID(move))) throw Error(`No move named ${move}`); return calculate( gen,