Skip to content

Commit

Permalink
Fixed a bug allowing healing items to be used on fainted Pokémon
Browse files Browse the repository at this point in the history
This fixes #202.
  • Loading branch information
varkor committed Feb 10, 2016
1 parent 57f6805 commit 5cb836b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions battle/scripts/objects/general/BattleContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,10 @@ function BattleContext (client) {
});
targets.reverse();
}
targets = targets.filter(poke => poke.egg === null);
if (item.use === "healing") {
targets = targets.filter(poke => poke.conscious());
}
return targets;
},
targetsForMove : function (user, move, excludeAlliesIfPossible) {
Expand Down

0 comments on commit 5cb836b

Please sign in to comment.