From 3da9754fbc1e79d52554caa872f403a0701de482 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Fri, 8 Jan 2016 18:33:10 +0100 Subject: [PATCH] [death_messages] Don't repeat death messages/sounds - For #375 --- mods/death_messages/init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/death_messages/init.lua b/mods/death_messages/init.lua index 461fe628..ac7d404f 100755 --- a/mods/death_messages/init.lua +++ b/mods/death_messages/init.lua @@ -182,6 +182,8 @@ minetest.register_on_punchplayer(function(player, hitter, time, death_message = string.format(messages.monsters_whacking[math.random(1, #messages.monsters_whacking)], player_name, entity_name, player_name, entity_name) end broadcast_death(death_message) + minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=soundset.get_gain(player:get_player_name(),"other")}) + sound_play_all(player:get_player_name()) whacked[player_name] = true end end) @@ -230,9 +232,10 @@ if RANDOM_MESSAGES == true then -- Actually tell something death_message = string.format(death_message, player_name, player_name) broadcast_death(death_message) + minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player_name,gain=soundset.get_gain(player_name, "other")}) + sound_play_all(player_name) + whacked[player_name] = true end - minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=soundset.get_gain(player:get_player_name(),"other")}) - sound_play_all(player:get_player_name()) end) else