diff --git a/rot.js b/rot.js index e5efe5a..c04f7e1 100644 --- a/rot.js +++ b/rot.js @@ -77,7 +77,7 @@ function volumeSet(number) { audio.volume = number; //Set - localStorage.audiovolume = Math.round(number * 100); //Save + localStorage.audiovolume = number; //Save updateVolumeLabel(); } function volumeAdd(number) { @@ -249,8 +249,8 @@ audio.loop = true; audio.id = "user-music"; audio.style = "display:none;"; - if (localStorage.audiovolume) - audio.volume = localStorage.audiovolume / 100; //Load volume + if (localStorage.audiovolume && localStorage.audiovolume >= 0 && localStorage.audiovolume <= 1) + audio.volume = localStorage.audiovolume; //Load volume else audio.volume = 0.2; //Default volume