#5266 check if npc for npc_talk_privs exists

This commit is contained in:
Sokomine 2024-12-15 16:57:27 +01:00
parent 0316afdfa9
commit 9797ada402

View File

@ -114,6 +114,12 @@ yl_speak_up.command_npc_talk_privs = function(pname, param)
table.concat(yl_speak_up.npc_priv_names, ", ")..".")
return
end
-- revoking privs of nonexistant NPC is allowed - but not granting them privs
if(command == "grant" and not(yl_speak_up.npc_list[n_id])) then
minetest.chat_send_player(pname,
"Unknown NPC \""..tostring(n_id).."\".\n")
return
end
if(command == "grant" and not(yl_speak_up.npc_priv_table[n_id])) then
yl_speak_up.npc_priv_table[n_id] = {}
end