diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index cb1f986b69d..0d51ed39ec1 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -16,6 +16,8 @@ return A /proc/get_area(O) + if(isarea(O)) + return O var/turf/loc = get_turf(O) if(loc) var/area/res = loc.loc diff --git a/code/modules/media/mediamanager.dm b/code/modules/media/mediamanager.dm index 9e5aa79fbbe..bf9d6a58c52 100644 --- a/code/modules/media/mediamanager.dm +++ b/code/modules/media/mediamanager.dm @@ -30,26 +30,13 @@ function SetMusic(url, time, volume) { vlc.playlist.playItem(id); vlc.input.time = time*1000; // VLC takes milliseconds. - vlc.audio.volume = volume*100; // \[0-200] + // for whatever reason, VLC plugin requires a delay between playing and setting volume + // also scaling it log-wise so that it's a more useful range + setTimeout(function() { vlc.audio.volume = Math.log(volume) / Math.LN10 * 50 }, 100); // volume ranges from 0-200 } "} -/* OLD, DO NOT USE. CONTROLS.CURRENTPOSITION IS BROKEN. -var/const/PLAYER_HTML={" - - "} -*/ - // Hook into the events we desire. /hook_handler/soundmanager // Set up player on login