check for missing item in player_inv/npc_inv

This commit is contained in:
Sokomine 2021-07-02 21:25:41 +02:00
parent c44ee99fbc
commit 522179cf28

View File

@ -302,6 +302,15 @@ yl_speak_up.save_element_p_or_a_or_e = function(
elseif((data.what == 5 or data.what == 6) and id_prefix == "p_") then
v.p_value = values_inv[ data.inv ]
if(v.p_value and v.p_value ~= "inv_is_empty") then
if(not(data.inv_stack_name) or data.inv_stack_name == "") then
yl_speak_up.show_fs(player, "msg", {
input_to = "yl_speak_up:"..formspec_input_to,
formspec = "size[8,2]"..
"label[0.2,0.5;Error: Please provide the name of the "..
"\nitem you want to check for!]"..
"button[1.5,1.5;2,0.9;back_from_error_msg;Back]"})
return
end
-- we have checked this value earlier on
v[ "p_itemstack" ] = data.inv_stack_name
end