]> git.lizzy.rs Git - crafter_client.git/commitdiff
Fix annoying sound overlap in portals
authoroilboi <47129783+oilboi@users.noreply.github.com>
Mon, 4 May 2020 22:40:05 +0000 (18:40 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Mon, 4 May 2020 22:40:05 +0000 (18:40 -0400)
aether.lua
nether [deleted file]
nether.lua

index 60b5f61f0cea0bf2cc890e0e452640b7f7c6f623..88d4d983c63f0c30277703b933d173eab353f4ed 100644 (file)
@@ -46,7 +46,7 @@ minetest.register_globalstep(function(dtime)
        elseif hud_bg_id then
                --play heavenly sounds
                
-               if init_sound then
+               if init_sound and node and node.name == "aether:portal" then
                        minetest.sound_fade(init_sound, -0.4, 0)
                        init_sound = nil
                        teleport_sound = minetest.sound_play("aether_teleport_complete",{gain=1})
@@ -59,6 +59,11 @@ minetest.register_globalstep(function(dtime)
                        opacity = opacity  - (dtime*100)                        
                        minetest.localplayer:hud_change(hud_bg_id, "text", "aether_portal_gui.png^[opacity:"..opacity)
                        
+                       if init_sound then
+                               minetest.sound_fade(init_sound, -0.4, 0)
+                               init_sound = nil
+                       end
+                       
                        if opacity <= 0 then
                                minetest.localplayer:hud_remove(hud_bg_id)
                                hud_bg_id = nil
diff --git a/nether b/nether
deleted file mode 100644 (file)
index 8b13789..0000000
--- a/nether
+++ /dev/null
@@ -1 +0,0 @@
-
index 667582d2dece06ef658ea0c5d84b4795719f2daa..1d58e962f9da39255b8251c0de3122eafb65d221 100644 (file)
@@ -46,7 +46,7 @@ minetest.register_globalstep(function(dtime)
        elseif hud_bg_id then
                --play heavenly sounds
                
-               if init_sound then
+               if init_sound and node and node.name == "nether:portal" then
                        minetest.sound_fade(init_sound, -0.4, 0)
                        init_sound = nil
                        teleport_sound = minetest.sound_play("portal_teleported",{gain=1})
@@ -59,6 +59,11 @@ minetest.register_globalstep(function(dtime)
                        opacity = opacity  - (dtime*100)                        
                        minetest.localplayer:hud_change(hud_bg_id, "text", "nether_portal_gui.png^[opacity:"..opacity)
                        
+                       if init_sound then
+                               minetest.sound_fade(init_sound, -0.4, 0)
+                               init_sound = nil
+                       end
+                       
                        if opacity <= 0 then
                                minetest.localplayer:hud_remove(hud_bg_id)
                                hud_bg_id = nil