Fade out rain and fire sounds
parent
aced401c6c
commit
ed336829b4
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue