From e139077ee5487e1e3be8c32f1615deb56eed1449 Mon Sep 17 00:00:00 2001 From: exane Date: Mon, 22 Jun 2015 17:42:48 +0200 Subject: [PATCH] minor bugfixes --- client/js/client.js | 2 +- client/templates/battle.handlebars | 2 +- gulpfile.js | 1 + server/Battle.js | 11 +++++++---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/client/js/client.js b/client/js/client.js index f8bb2a2..a22f3ff 100644 --- a/client/js/client.js +++ b/client/js/client.js @@ -4,7 +4,6 @@ var Backbone = require("backbone"); require("./backbone.modal-min"); var Handlebars = require("handlebars"); var $ = require("jquery"); -//var Lobby = require("./client-lobby"); window.$ = $; @@ -307,6 +306,7 @@ var BattleView = Backbone.View.extend({ onClickFieldCard: function(e){ if(this.user.get("waitForDecoy")){ var $card = $(e.target).closest(".card"); + if(!$card.length) return; var _id = $card.data("id"); if($card.parent().hasClass("field-horn")) return; diff --git a/client/templates/battle.handlebars b/client/templates/battle.handlebars index 072c25b..9708466 100644 --- a/client/templates/battle.handlebars +++ b/client/templates/battle.handlebars @@ -89,7 +89,7 @@
-
+
0
diff --git a/gulpfile.js b/gulpfile.js index afe405c..5f195b5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -59,6 +59,7 @@ gulp.task("unit tests", function(){ gulp.task("watch", function(){ gulp.watch("./client/js/*", ["browserify"]); + gulp.watch("./client/templates/*", ["browserify"]); gulp.watch("./client/scss/*", ["sass"]); gulp.watch("./client/*.html", ["index"]); gulp.watch("./test/src/*", ["unit tests"]); diff --git a/server/Battle.js b/server/Battle.js index c424190..8a91f17 100644 --- a/server/Battle.js +++ b/server/Battle.js @@ -61,9 +61,13 @@ var Battle = (function(){ this.p2.setLeadercard(); this.p1.draw(10); this.p2.draw(10); - /*this.p1.hand.add(Card("commanders_horn")); + this.p1.hand.add(Card("commanders_horn")); this.p2.hand.add(Card("commanders_horn")); - this.p1.hand.add(Card("milva")); + this.p1.hand.add(Card("ciaran_aep_easnillien")); + this.p2.hand.add(Card("ciaran_aep_easnillien")); + /*this.p1.hand.add(Card("decoy")); + this.p2.hand.add(Card("decoy"));*/ + /*this.p1.hand.add(Card("milva")); this.p2.hand.add(Card("milva")); this.p1.hand.add(Card("havekar_healer")); this.p2.hand.add(Card("havekar_healer")); @@ -96,8 +100,7 @@ var Battle = (function(){ this.p2.hand.add(Card("ballista")); this.p1.hand.add(Card("ballista")); this.p2.hand.add(Card("ballista"));*/ - /*this.p1.hand.add(Card("decoy")); - this.p2.hand.add(Card("decoy"));*/ + /* this.p1.hand.add(Card("dun_banner_medic")); this.p2.hand.add(Card("dun_banner_medic"));