Fade out rain and fire sounds

This commit is contained in:
Wuzzy 2019-09-05 00:07:32 +02:00
parent aced401c6c
commit ed336829b4
2 changed files with 3 additions and 3 deletions

View file

@ -127,7 +127,7 @@ mcl_weather.rain.update_sound = function(player)
if player_meta.sound_handler ~= nil then if player_meta.sound_handler ~= nil then
if mcl_weather.rain.last_rp_count == 0 then if mcl_weather.rain.last_rp_count == 0 then
minetest.sound_stop(player_meta.sound_handler) minetest.sound_fade(player_meta.sound_handler, -0.5, 0.0)
player_meta.sound_handler = nil player_meta.sound_handler = nil
end end
elseif mcl_weather.rain.last_rp_count > 0 then elseif mcl_weather.rain.last_rp_count > 0 then
@ -142,7 +142,7 @@ end
mcl_weather.rain.remove_sound = function(player) mcl_weather.rain.remove_sound = function(player)
local player_meta = mcl_weather.players[player:get_player_name()] local player_meta = mcl_weather.players[player:get_player_name()]
if player_meta ~= nil and player_meta.sound_handler ~= nil then if player_meta ~= nil and player_meta.sound_handler ~= nil then
minetest.sound_stop(player_meta.sound_handler) minetest.sound_fade(player_meta.sound_handler, -0.5, 0.0)
player_meta.sound_handler = nil player_meta.sound_handler = nil
player_meta.sound_updated = nil player_meta.sound_updated = nil
end end

View file

@ -217,7 +217,7 @@ if flame_sound then
(num["mcl_fire:eternal_fire"] or 0) (num["mcl_fire:eternal_fire"] or 0)
-- Stop previous sound -- Stop previous sound
if handles[player_name] then if handles[player_name] then
minetest.sound_stop(handles[player_name]) minetest.sound_fade(handles[player_name], -0.4, 0.0)
handles[player_name] = nil handles[player_name] = nil
end end
-- If flames -- If flames