#5266 check if npc for npc_talk_privs exists
This commit is contained in:
parent
0316afdfa9
commit
9797ada402
@ -114,6 +114,12 @@ yl_speak_up.command_npc_talk_privs = function(pname, param)
|
|||||||
table.concat(yl_speak_up.npc_priv_names, ", ")..".")
|
table.concat(yl_speak_up.npc_priv_names, ", ")..".")
|
||||||
return
|
return
|
||||||
end
|
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
|
if(command == "grant" and not(yl_speak_up.npc_priv_table[n_id])) then
|
||||||
yl_speak_up.npc_priv_table[n_id] = {}
|
yl_speak_up.npc_priv_table[n_id] = {}
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user