mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Proposed bug fix, issue #6668 - erroneous reward purchase sound
This commit is contained in:
committed by
Blade Barringer
parent
2a4a8466ca
commit
7b708f51ba
@@ -12,7 +12,10 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
|||||||
$scope.score = function(task, direction) {
|
$scope.score = function(task, direction) {
|
||||||
switch (task.type) {
|
switch (task.type) {
|
||||||
case 'reward':
|
case 'reward':
|
||||||
|
//Covers custom rewards
|
||||||
|
if(task.value <= User.user.stats.gp){
|
||||||
$rootScope.playSound('Reward');
|
$rootScope.playSound('Reward');
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'daily':
|
case 'daily':
|
||||||
$rootScope.playSound('Daily');
|
$rootScope.playSound('Daily');
|
||||||
@@ -221,7 +224,11 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
|||||||
|
|
||||||
$scope.buy = function(item) {
|
$scope.buy = function(item) {
|
||||||
User.user.ops.buy({params:{key:item.key}});
|
User.user.ops.buy({params:{key:item.key}});
|
||||||
|
//Plays sound for built in rewards (armor, potions etc)
|
||||||
|
if(item.value <= User.user.stats.gp){
|
||||||
$rootScope.playSound('Reward');
|
$rootScope.playSound('Reward');
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user