Fix Travis CI errors

This commit is contained in:
The Immortal
2014-11-22 19:25:33 +04:00
parent 669b6ca066
commit e2af6d65cc
2 changed files with 7 additions and 4 deletions

View File

@@ -200,7 +200,8 @@ BattlePokemon = (function () {
this.baseAbility = toId(set.ability);
this.ability = this.baseAbility;
this.item = toId(set.item);
if (this.baseTemplate.otherFormes) var forme = this.battle.getTemplate(this.baseTemplate.otherFormes[0]);
var forme;
if (this.baseTemplate.otherFormes) forme = this.battle.getTemplate(this.baseTemplate.otherFormes[0]);
this.canMegaEvo = ((this.battle.getItem(this.item).megaEvolves === this.baseTemplate.baseSpecies) || (forme && forme.isMega && forme.requiredMove && this.set.moves.indexOf(toId(forme.requiredMove)) > -1));
this.abilityData = {id: this.ability};
this.itemData = {id: this.item};

View File

@@ -537,14 +537,16 @@ exports.BattleScripts = {
var side = pokemon.side;
if (side.megaEvo) return false;
if (pokemon.baseTemplate.otherFormes) var otherForme = this.getTemplate(pokemon.baseTemplate.otherFormes[0]);
var otherForme;
var template;
if (pokemon.baseTemplate.otherFormes) otherForme = this.getTemplate(pokemon.baseTemplate.otherFormes[0]);
if (otherForme && otherForme.isMega && otherForme.requiredMove) {
if (pokemon.moves.indexOf(toId(otherForme.requiredMove)) < 0) return false;
var template = otherForme;
template = otherForme;
} else {
var item = this.getItem(pokemon.item);
if (!item.megaStone) return false;
var template = this.getTemplate(item.megaStone);
template = this.getTemplate(item.megaStone);
if (pokemon.baseTemplate.baseSpecies !== template.baseSpecies) return false;
}
if (!template.isMega) return false;