Proposed bug fix, issue #6668 - erroneous reward purchase sound

This commit is contained in:
Kenny Carlsen
2016-03-06 21:06:58 -05:00
committed by Blade Barringer
parent 2a4a8466ca
commit 7b708f51ba

View File

@@ -12,7 +12,10 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
$scope.score = function(task, direction) {
switch (task.type) {
case 'reward':
$rootScope.playSound('Reward');
//Covers custom rewards
if(task.value <= User.user.stats.gp){
$rootScope.playSound('Reward');
}
break;
case 'daily':
$rootScope.playSound('Daily');
@@ -221,7 +224,11 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
$scope.buy = function(item) {
User.user.ops.buy({params:{key:item.key}});
$rootScope.playSound('Reward');
//Plays sound for built in rewards (armor, potions etc)
if(item.value <= User.user.stats.gp){
$rootScope.playSound('Reward');
}
};