properly check privs of generic npc when used by other npc
This commit is contained in:
parent
48c722c943
commit
952111c7fe
@ -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
|
if(not(n_id) or not(priv_name)) then
|
||||||
return false
|
return false
|
||||||
end
|
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
|
-- if the precondition or effect come from a generic_npc and that
|
||||||
-- generic npc has the desired priv, then the priv has been granted
|
-- generic npc has the desired priv, then the priv has been granted
|
||||||
if(generic_npc_id
|
if(generic_npc_id
|
||||||
|
Loading…
Reference in New Issue
Block a user