mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-11 22:46:47 +00:00
fix(spookDust): user serverside method for spookdust as it's path-protected
This commit is contained in:
parent
4925882804
commit
e666d2f837
1 changed files with 1 additions and 5 deletions
|
|
@ -87,11 +87,7 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', '$window', 'User',
|
|||
}
|
||||
|
||||
$scope.purchase = function(type, item){
|
||||
if (item.key=='spookDust') {
|
||||
// FIXME stupid method of special-handling spookDust, since it can be purchased with gold and the system only accomodates gem-purchasable holiday spells
|
||||
if (user.stats.gp < item.value) return alert(window.env.t('messageNotEnoughGold'));
|
||||
return User.set({'stats.gp':user.stats.gp-item.value, 'items.special.spookDust':(user.items.special.spookDust || 0)+1});
|
||||
}
|
||||
if (item.key=='spookDust') return User.user.ops.buySpookDust({});
|
||||
|
||||
var gems = User.user.balance * 4;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue