diff options
author | cheapie <no-email-for-you@example.com> | 2024-09-14 15:14:04 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2024-09-14 15:14:04 -0500 |
commit | 07a87d8494d462934d67d773bb49cc55f34a83af (patch) | |
tree | e3df339347dd18bc14a4b542b63c5ad07038d431 /init.lua | |
parent | da5e807e3f8630dc0b3eaa6d34f57d3933aa532d (diff) | |
download | handdryer-07a87d8494d462934d67d773bb49cc55f34a83af.tar handdryer-07a87d8494d462934d67d773bb49cc55f34a83af.tar.gz handdryer-07a87d8494d462934d67d773bb49cc55f34a83af.tar.bz2 handdryer-07a87d8494d462934d67d773bb49cc55f34a83af.tar.xz handdryer-07a87d8494d462934d67d773bb49cc55f34a83af.zip |
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -89,7 +89,6 @@ minetest.register_node("handdryer:xa5",{ "handdryer_xa5_front.png", }, on_destruct = function(pos) - local posbelow = vector.add(pos,vector.new(0,-1,0)) local hash = minetest.hash_node_position(pos) local handle = sounds[hash] local meta = minetest.get_meta(pos) @@ -121,11 +120,10 @@ minetest.register_abm({ if handle then minetest.sound_stop(handle) end meta:set_int("running",1) minetest.sound_play("handdryer_xa5_start",{pos=pos,gain=0.75,max_hear_distance=20}) - minetest.after(2,function(pos,hash) - local meta = minetest.get_meta(pos) - if not meta:get_int("running") == 1 then return end + minetest.after(2,function() + if meta:get_int("running") ~= 1 then return end sounds[hash] = minetest.sound_play("handdryer_xa5_run",{pos=pos,gain=0.75,max_hear_distance=20,loop=true}) - end,pos,hash) + end) end else if handle then minetest.sound_stop(handle) end |