mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-25 00:06:18 +00:00
Fixed entry hazard crash
Having Spikes or Stealth Rock on the field when a new wild battle starts no longer crashes the game.
This commit is contained in:
parent
d4c265443f
commit
587197dac4
@ -252,7 +252,7 @@ class SpikesTag extends ArenaTrapTag {
|
||||
|
||||
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' is hurt\nby the spikes!'));
|
||||
pokemon.damageAndUpdate(damage, HitResult.OTHER);
|
||||
pokemon.turnData.damageTaken += damage;
|
||||
if (pokemon.turnData) pokemon.turnData.damageTaken += damage;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -383,7 +383,7 @@ class StealthRockTag extends ArenaTrapTag {
|
||||
const damage = Math.ceil(pokemon.getMaxHp() * damageHpRatio);
|
||||
pokemon.scene.queueMessage(`Pointed stones dug into\n${pokemon.name}!`);
|
||||
pokemon.damageAndUpdate(damage, HitResult.OTHER);
|
||||
pokemon.turnData.damageTaken += damage;
|
||||
if (pokemon.turnData) pokemon.turnData.damageTaken += damage;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user