From c716f74812ff8e6ebd39d82e56606524b588ba34 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Thu, 19 Dec 2024 22:56:36 +0100 Subject: [PATCH] #5501 player needs configured privs to store things requiring npc_privs --- api/fs_edit_general.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/api/fs_edit_general.lua b/api/fs_edit_general.lua index bc088cc..de19d3d 100644 --- a/api/fs_edit_general.lua +++ b/api/fs_edit_general.lua @@ -318,7 +318,8 @@ yl_speak_up.save_element_p_or_a_or_e = function( return end local priv_list = {} - if(not(yl_speak_up.save_element_check_priv(player, yl_speak_up.npc_privs_priv, + if(not(yl_speak_up.save_element_check_priv(player, + yl_speak_up.npc_priv_needs_player_priv["effect_"..what_type] or "privs", formspec_input_to, " in order to set this effect"))) then return end @@ -336,7 +337,8 @@ yl_speak_up.save_element_p_or_a_or_e = function( "button[1.5,1.5;2,0.9;back_from_error_msg;Back]"}) return end - if(not(yl_speak_up.save_element_check_priv(player, yl_speak_up.npc_privs_priv, + if(not(yl_speak_up.save_element_check_priv(player, + yl_speak_up.npc_priv_needs_player_priv["effect_move_player"] or "privs", formspec_input_to, " in order to set this effect"))) then return end @@ -1870,6 +1872,7 @@ yl_speak_up.get_sub_fs_edit_option_precondition_entity_type = function( if(yl_speak_up.speak_to[pname].obj) then local obj = yl_speak_up.speak_to[pname].obj if(obj) then + local entity = obj:get_luaentity() local entity = obj:get_luaentity() if(entity) then data.entity_type = entity.name @@ -2001,7 +2004,7 @@ yl_speak_up.get_sub_fs_edit_option_effect_give_item_or_take_item = function( return formspec.. "label[0.2,3.0;"..text.."]".. "label[0.2,3.5;Note: You can *save* this effect only if you have the ".. - "\""..tostring(yl_speak_up.npc_privs_priv).."\" priv!]".. + "\""..tostring(yl_speak_up.npc_priv_needs_player_priv[priv_name] or "?").."\" priv!]".. "label[0.2,8.0;".. "And in order to be able to execute it, this NPC\n".. "needs the \""..tostring(priv_name).."\" priv.\n\t".. @@ -2028,7 +2031,8 @@ yl_speak_up.get_sub_fs_edit_option_effect_move = function( return formspec.. "label[0.2,3.0;Move the player to this position:]".. "label[0.2,3.5;Note: You can *save* this effect only if you have the ".. - "\""..tostring(yl_speak_up.npc_privs_priv).."\" priv!\n".. + "\""..tostring(yl_speak_up.npc_priv_needs_player_priv["effect_move_player"] or "?").. + "\" priv!\n".. "And in order to be able to execute it, this NPC needs the \"".. "effect_move_player\" priv.\n\t".. "Type \"/npc_talk_privs grant "..tostring(yl_speak_up.speak_to[pname].n_id)..