From 5edb0da5a78651837ec69e7d77ac0192f1e26b7d Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sun, 27 Jun 2021 17:52:06 +0200 Subject: [PATCH] translate item precondition to player_inv precondition when editing --- fs_edit_general.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs_edit_general.lua b/fs_edit_general.lua index 20aa821..5aae23c 100644 --- a/fs_edit_general.lua +++ b/fs_edit_general.lua @@ -897,6 +897,14 @@ yl_speak_up.get_fs_edit_option_related = function(player, table_click_result, "Use the edit options or dialog menu to change the target dialog.]".. "button[1.5,1.5;2,0.9;back_from_cannot_be_edited;Back]" end + if( id_prefix == "p_" and e[ "p_type" ] == "item") then + -- the staff-based item precondition can be translated to an editable + -- inventory precondition which is equal + e[ "p_type" ] = "player_inv" + e[ "p_itemstack" ] = e[ "p_value"] + e[ "p_value" ] = "inv_contains" + end + data.what = table.indexof(values_what, e[ id_prefix.."type" ]) if(data.what == -1) then data.what = 1