moved logging of mute/unmute to yl_speak_up.log_change

This commit is contained in:
Sokomine 2022-09-09 23:39:12 +02:00
parent f714fd426b
commit 6fe611a267

View File

@ -495,21 +495,17 @@ yl_speak_up.set_muted = function(p_name, obj, set_muted)
luaentity.yl_speak_up.talk = false
yl_speak_up.update_nametag(luaentity)
minetest.chat_send_player(p_name,"NPC with ID "..npc.." will shut up at pos "..
minetest.chat_send_player(p_name,"NPC with ID n_"..npc.." will shut up at pos "..
minetest.pos_to_string(obj:get_pos(),0).." on command of "..p_name)
minetest.log("action","[MOD] yl_speak_up: NPC with ID n_"..npc..
" will shut up at pos "..minetest.pos_to_string(obj:get_pos(),0)..
" on command of "..p_name)
yl_speak_up.log_change(p_name, "n_"..npc, "muted - NPC stops talking")
elseif(not(set_muted) and not(luaentity.yl_speak_up.talk)) then
-- mute the npc
luaentity.yl_speak_up.talk = true
yl_speak_up.update_nametag(luaentity)
minetest.chat_send_player(p_name,"NPC with ID "..npc.." will resume speech at pos "..
minetest.chat_send_player(p_name,"NPC with ID n_"..npc.." will resume speech at pos "..
minetest.pos_to_string(obj:get_pos(),0).." on command of "..p_name)
minetest.log("action","[MOD] yl_speak_up: NPC with ID n_"..npc..
" will resume speech at pos "..minetest.pos_to_string(obj:get_pos(),0)..
" on command of "..p_name)
yl_speak_up.log_change(p_name, "n_"..npc, "unmuted - NPC talks again")
end
end