mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-29 18:26:09 +00:00
[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 {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
const stockpilingTag = user.getTag(StockpilingTag);
|
const stockpilingTag = user.getTag(StockpilingTag);
|
||||||
|
|
||||||
if (stockpilingTag !== null && stockpilingTag.stockpiledCount > 0) {
|
if (stockpilingTag && stockpilingTag.stockpiledCount > 0) {
|
||||||
const power = args[0] as Utils.IntegerHolder;
|
const power = args[0] as Utils.IntegerHolder;
|
||||||
power.value = this.multiplier * stockpilingTag.stockpiledCount;
|
power.value = this.multiplier * stockpilingTag.stockpiledCount;
|
||||||
return true;
|
return true;
|
||||||
@ -3490,7 +3490,7 @@ export class SwallowHealAttr extends HealAttr {
|
|||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
const stockpilingTag = user.getTag(StockpilingTag);
|
const stockpilingTag = user.getTag(StockpilingTag);
|
||||||
|
|
||||||
if (stockpilingTag !== null && stockpilingTag?.stockpiledCount > 0) {
|
if (stockpilingTag && stockpilingTag.stockpiledCount > 0) {
|
||||||
const stockpiled = stockpilingTag.stockpiledCount;
|
const stockpiled = stockpilingTag.stockpiledCount;
|
||||||
let healRatio: number;
|
let healRatio: number;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user