Skip to content

Commit

Permalink
fix sound playing
Browse files Browse the repository at this point in the history
  • Loading branch information
naturefreshmilk committed Nov 30, 2018
1 parent 3090c7e commit 35dfe80
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@

local disable_sounds = minetest.settings:get_bool("shields_disable_sounds")

local function play_sound_effect(player, name)
if not disable_sounds and player then
local pos = player:getpos()
if pos then
minetest.sound_play(name, {
pos = pos,
max_hear_distance = 10,
gain = 0.5,
})
end
end
end

armor:register_armor("moderator_armor:helmet", {
description = "Moderator Helmet",
inventory_image = "moderator_armor_inv_helmet.png",
Expand Down

0 comments on commit 35dfe80

Please sign in to comment.