From 23556697618ebf06e77edaecbfce7296c1c9549c Mon Sep 17 00:00:00 2001 From: Sokomine Date: Tue, 2 Aug 2022 21:41:05 +0200 Subject: [PATCH] handled edge case in npc_talk_generic --- command_npc_talk_generic.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command_npc_talk_generic.lua b/command_npc_talk_generic.lua index eed17ae..1deffa8 100644 --- a/command_npc_talk_generic.lua +++ b/command_npc_talk_generic.lua @@ -24,6 +24,10 @@ minetest.register_chatcommand( 'npc_talk_generic', { local res = yl_speak_up.check_and_add_as_generic_dialog(dialog, n_id) minetest.chat_send_player(pname, "Adding NPC "..tostring(n_id).."..: "..tostring(res)) do_reload = true + elseif(parts[1] == "add" and i ~= -1) then + minetest.chat_send_player(pname, "NPC "..tostring(parts[2]).. + " is already registered as a generic NPC. You may try to ".. + "remove and add it again if something went wrong.") elseif(parts[1] == "remove" and i ~= -1) then table.remove(generic_npc_list, i) minetest.chat_send_player(pname, "Removing NPC "..tostring(parts[2]).." ..")