Merge pull request #3987 from Alys/soundOff404-Sep05

prevent harmless but annoying 404 errors for sound files when sound is off
This commit is contained in:
Tyler Renelle 2014-09-05 16:08:14 -06:00
commit 7e91fa4524

View file

@ -50,7 +50,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
}
$rootScope.playSound = function(id){
if (!user.preferences.sound) return;
if (!user.preferences.sound || user.preferences.sound == 'off') return;
var theme = user.preferences.sound;
var file = 'audio/' + theme + '/' + id;
document.getElementById('oggSource').src = file + '.ogg';