From 4ab89d358027c01894a93494b62b608ab6d0ef30 Mon Sep 17 00:00:00 2001 From: Shaun Date: Wed, 24 May 2017 13:05:52 +0200 Subject: [PATCH] Fixes #129 --- src/client/js/components/spellbook.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/client/js/components/spellbook.js b/src/client/js/components/spellbook.js index a8af47d1..2c34569a 100644 --- a/src/client/js/components/spellbook.js +++ b/src/client/js/components/spellbook.js @@ -28,7 +28,7 @@ define([ renderRange: null, reticleSprite: null, - tarpSprite: null, + targetSprite: null, shiftDown: false, @@ -141,7 +141,12 @@ define([ }, tabTarget: function() { - this.onMouseDown(null, objects.getClosest(window.player.x, window.player.y, 10, this.shiftDown, this.target)); + var closest = objects.getClosest(window.player.x, window.player.y, 10, this.shiftDown, this.target); + + this.target = closest; + this.targetSprite.visible = !!this.target; + + events.emit('onSetTarget', this.target, null); }, build: function(destroy) {