translate item precondition to player_inv precondition when editing

This commit is contained in:
Sokomine 2021-06-27 17:52:06 +02:00
parent 46f5232d49
commit 5edb0da5a7

View File

@ -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