handled edge case in npc_talk_generic

This commit is contained in:
Sokomine 2022-08-02 21:41:05 +02:00
parent 87e3bc9176
commit 2355669761

View File

@ -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]).." ..")