From 04df61fb5345cf813fb7b236181b593781e4828a Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Tue, 17 Dec 2013 19:33:36 -0700 Subject: [PATCH] fix #2030, immediately "fulfill" spell cast, don't wait for server response --- public/js/controllers/rootCtrl.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/js/controllers/rootCtrl.js b/public/js/controllers/rootCtrl.js index 96ab3039ca..a146e59d23 100644 --- a/public/js/controllers/rootCtrl.js +++ b/public/js/controllers/rootCtrl.js @@ -165,6 +165,8 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$ $scope.castEnd = function(target, type, $event){ if ($scope.spell.target != type) return Notification.text("Invalid target"); $scope.spell.cast(User.user, target); + $rootScope.applyingAction = false; + $scope.spell = null; $http.post('/api/v2/user/class/cast/' + $scope.spell.name, {target:target, type:type}).success(function(){ var msg = "You cast " + $scope.spell.text; switch (type) { @@ -173,9 +175,6 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$ case 'party': msg += ' on the Party';break; } Notification.text(msg); - $rootScope.applyingAction = false; - $scope.spell = null; - //User.sync(); // FIXME push a lot of the server code to also in client, so we can run updates in browser without requiring sync }) $event && $event.stopPropagation(); }