fix undefined property error

This commit is contained in:
innerthunder 2024-10-01 16:13:30 -07:00
parent 01f3b00bc4
commit 8c1adbc2f0

View File

@ -1538,9 +1538,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
* @returns The type damage multiplier, indicating the effectiveness of the move
*/
getMoveEffectiveness(source: Pokemon, move: Move, ignoreAbility: boolean = false, simulated: boolean = true, cancelled?: Utils.BooleanHolder): TypeDamageMultiplier {
if (this.turnData.moveEffectiveness !== null) {
if (!Utils.isNullOrUndefined(this.turnData.moveEffectiveness)) {
return this.turnData.moveEffectiveness;
}
if (move.hasAttr(TypelessAttr)) {
return 1;
}