[Bug] Fix console error from undefined stockpilingTag (#4118)
This commit is contained in:
parent
68b956cbe6
commit
06f98f6737
|
@ -3472,7 +3472,7 @@ export class SpitUpPowerAttr extends VariablePowerAttr {
|
|||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
const stockpilingTag = user.getTag(StockpilingTag);
|
||||
|
||||
if (stockpilingTag !== null && stockpilingTag.stockpiledCount > 0) {
|
||||
if (stockpilingTag && stockpilingTag.stockpiledCount > 0) {
|
||||
const power = args[0] as Utils.IntegerHolder;
|
||||
power.value = this.multiplier * stockpilingTag.stockpiledCount;
|
||||
return true;
|
||||
|
@ -3490,7 +3490,7 @@ export class SwallowHealAttr extends HealAttr {
|
|||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
const stockpilingTag = user.getTag(StockpilingTag);
|
||||
|
||||
if (stockpilingTag !== null && stockpilingTag?.stockpiledCount > 0) {
|
||||
if (stockpilingTag && stockpilingTag.stockpiledCount > 0) {
|
||||
const stockpiled = stockpilingTag.stockpiledCount;
|
||||
let healRatio: number;
|
||||
|
||||
|
|
Loading…
Reference in New Issue