Fix Illusion failing to fake trapping abilities

It wouldn't activate the "maybeTrapped" flag.
This commit is contained in:
Ivo Julca 2014-10-15 01:37:33 -05:00
parent 8afc588e4f
commit 62d5652746

View File

@ -363,16 +363,17 @@ BattlePokemon = (function () {
if (side === this.side) continue;
for (var j = 0; j < side.active.length; ++j) {
var pokemon = side.active[j];
if (!pokemon || pokemon.fainted ||
!pokemon.template.abilities) continue;
for (var k in pokemon.template.abilities) {
var ability = pokemon.template.abilities[k];
if (!pokemon || pokemon.fainted) continue;
var template = (pokemon.illusion || pokemon).template;
if (!template.abilities) continue;
for (var k in template.abilities) {
var ability = template.abilities[k];
if (ability === pokemon.ability) {
// This event was already run above so we don't need
// to run it again.
continue;
}
if ((k === 'H') && pokemon.template.unreleasedHidden) {
if ((k === 'H') && template.unreleasedHidden) {
// unreleased hidden ability
continue;
}