Make sure a Pokemon faints properly after using Explosion

This commit is contained in:
Guangcong Luo 2012-12-13 04:10:14 -08:00
parent 7ed807aacc
commit 54bcd9ab33
2 changed files with 4 additions and 1 deletions

View File

@ -1353,7 +1353,9 @@ function Battle(roomid, format, rated) {
return Math.random()-0.5;
});
for (var i=0; i<actives.length; i++) {
if (actives[i].isStarted) selfB.runEvent(eventid, actives[i], null, effect, relayVar);
if (actives[i].isStarted) {
selfB.runEvent(eventid, actives[i], null, effect, relayVar);
}
}
};
this.residualEvent = function(eventid, relayVar) {

View File

@ -138,6 +138,7 @@ exports.BattleScripts = {
}
return true;
}
if (!pokemon.hp) pokemon.faint();
} else {
if (target.fainted && target.side !== pokemon.side) {
// if a targeted foe faints, the move is retargeted