properly check privs of generic npc when used by other npc

This commit is contained in:
Sokomine 2022-07-09 22:15:51 +02:00
parent 48c722c943
commit 952111c7fe

View File

@ -49,6 +49,10 @@ yl_speak_up.npc_has_priv = function(n_id, priv_name, generic_npc_id)
if(not(n_id) or not(priv_name)) then
return false
end
-- remove the leading "_" from the n_id:
if(generic_npc_id) then
generic_npc_id = string.sub(generic_npc_id, 2)
end
-- if the precondition or effect come from a generic_npc and that
-- generic npc has the desired priv, then the priv has been granted
if(generic_npc_id