mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
save user on spell-cast (so we don't get second mp loss notif)
This commit is contained in:
@@ -165,6 +165,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
|||||||
$scope.castEnd = function(target, type, $event){
|
$scope.castEnd = function(target, type, $event){
|
||||||
if ($scope.spell.target != type) return Notification.text("Invalid target");
|
if ($scope.spell.target != type) return Notification.text("Invalid target");
|
||||||
$scope.spell.cast(User.user, target);
|
$scope.spell.cast(User.user, target);
|
||||||
|
User.save();
|
||||||
$http.post('/api/v2/user/class/cast/' + $scope.spell.name, {target:target, type:type}).success(function(){
|
$http.post('/api/v2/user/class/cast/' + $scope.spell.name, {target:target, type:type}).success(function(){
|
||||||
var msg = "You cast " + $scope.spell.text;
|
var msg = "You cast " + $scope.spell.text;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user