@@ -46,6 +46,14 @@ function doors.register_door(name, def)
46
46
def .selection_box_top = box
47
47
end
48
48
49
+ if not def .sound_close_door then
50
+ def .sound_close_door = " door_close"
51
+ end
52
+ if not def .sound_open_door then
53
+ def .sound_open_door = " door_open"
54
+ end
55
+
56
+
49
57
minetest .register_craftitem (name , {
50
58
description = def .description ,
51
59
inventory_image = def .inventory_image ,
@@ -138,17 +146,17 @@ function doors.register_door(name, def)
138
146
pos .y = pos .y - dir
139
147
minetest .swap_node (pos , {name = replace , param2 = p2 })
140
148
141
- local snd_1 = " _close "
142
- local snd_2 = " _open "
149
+ local snd_1 = def . sound_close_door
150
+ local snd_2 = def . sound_open_door
143
151
if params [1 ] == 3 then
144
- snd_1 = " _open "
145
- snd_2 = " _close "
152
+ snd_1 = def . sound_open_door
153
+ snd_2 = def . sound_close_door
146
154
end
147
155
148
156
if is_right (pos ) then
149
- minetest .sound_play (" door " .. snd_1 , {pos = pos , gain = 0.3 , max_hear_distance = 10 })
157
+ minetest .sound_play (snd_1 , {pos = pos , gain = 0.3 , max_hear_distance = 10 })
150
158
else
151
- minetest .sound_play (" door " .. snd_2 , {pos = pos , gain = 0.3 , max_hear_distance = 10 })
159
+ minetest .sound_play (snd_2 , {pos = pos , gain = 0.3 , max_hear_distance = 10 })
152
160
end
153
161
end
154
162
0 commit comments