diff --git a/index.html b/index.html index 4fd0ddc..32ee965 100644 --- a/index.html +++ b/index.html @@ -10,6 +10,8 @@
+
+
diff --git a/src/jsds_crafty.js b/src/jsds_crafty.js index fad6d0c..5bed572 100644 --- a/src/jsds_crafty.js +++ b/src/jsds_crafty.js @@ -78,7 +78,13 @@ this.enableControl(); }; if(e.mouseButton === Crafty.mouseButtons.RIGHT) { - cur_sel.attack(player[this.id]); + if ( !cur_sel ) { return; }; + if ( cur_sel == player[this.id]) + { + } + else { + cur_sel.attack(player[this.id]); + }; }; });