From 952111c7fe18f871971c206b2b8a4468a459f475 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sat, 9 Jul 2022 22:15:51 +0200 Subject: [PATCH] properly check privs of generic npc when used by other npc --- privs.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/privs.lua b/privs.lua index 11b7958..9e49862 100644 --- a/privs.lua +++ b/privs.lua @@ -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