mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-09 04:23:45 -05:00
Fix crash against Substitute
This commit is contained in:
parent
7ec8044b9c
commit
35ba7b70a2
|
|
@ -195,9 +195,7 @@ exports.BattleScripts = {
|
|||
}
|
||||
}
|
||||
|
||||
if (hitResult === 0) {
|
||||
target = null;
|
||||
} else if (!hitResult) {
|
||||
if (hitResult !== 0 && !hitResult) {
|
||||
if (hitResult === false) this.add('-fail', target);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -239,6 +237,11 @@ exports.BattleScripts = {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (hitResult === 0) {
|
||||
// substitute
|
||||
target = null;
|
||||
}
|
||||
|
||||
var damage = 0;
|
||||
pokemon.lastDamage = 0;
|
||||
if (move.multihit) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user