From 1d9328ddbdf0e5f25ac47626d8bcd955acceb8d8 Mon Sep 17 00:00:00 2001 From: exane Date: Thu, 2 Jul 2015 19:34:30 +0200 Subject: [PATCH] bug prevent + detection --- server/Battleside.js | 7 +++++-- server/Card.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server/Battleside.js b/server/Battleside.js index 534492a..5dbd6f6 100644 --- a/server/Battleside.js +++ b/server/Battleside.js @@ -624,12 +624,15 @@ Battleside = (function(){ r.setWeather = function(weather, opt){ var targetRow = weather; var field; - if(typeof targetRow === "undefined") return; + if(typeof targetRow === "undefined") { + console.log("setWeather: targetRow undefined", targetRow); + console.trace(this); + return; + } opt = opt || {}; var onRoundEnd = opt.onTurnEnd || false; - //console.log(this.field[Card.TYPE.WEATHER]); if(targetRow === Card.TYPE.WEATHER){ if(!onRoundEnd){ this.battle.sendNotification(this.getName() + " played Clear Weather!"); diff --git a/server/Card.js b/server/Card.js index f9ae438..e980fdb 100644 --- a/server/Card.js +++ b/server/Card.js @@ -89,7 +89,7 @@ var Card = (function(){ } r.setForcedPower = function(nr){ this._forcedPower = nr; - /*this.getBoost(); *///recalculate + this.getBoost(); //recalculate } r.getRawAbility = function(){ return this._data.ability;