Fixed error when calculating type effectiveness against a Pokémon with no types

This commit is contained in:
Maruno17
2022-05-28 23:07:55 +01:00
parent 325a1b2998
commit 9ecbee910d

View File

@@ -126,7 +126,7 @@ module Effectiveness
end
def calculate(attack_type, defend_type1, defend_type2 = nil, defend_type3 = nil)
mod1 = calculate_one(attack_type, defend_type1)
mod1 = (defend_type1) ? calculate_one(attack_type, defend_type1) : NORMAL_EFFECTIVE_ONE
mod2 = NORMAL_EFFECTIVE_ONE
mod3 = NORMAL_EFFECTIVE_ONE
if defend_type2 && defend_type1 != defend_type2