handle edit mode in trade_simple correctly

This commit is contained in:
Sokomine 2021-05-23 23:24:21 +02:00
parent b1a6b6f628
commit 6f5a84e6de

View File

@ -50,15 +50,16 @@ yl_speak_up.input_do_trade_simple = function(player, formname, fields)
-- go back to the main dialog
if(fields.abort_trade_simple or fields.quit or fields.finished_trading) then
local d_id = yl_speak_up.speak_to[pname].d_id
local n_id = yl_speak_up.speak_to[pname].n_id
-- if in edit mode: go back to the edit options dialog
if(trade.edit_trade) then
if(yl_speak_up.edit_mode[pname] == yl_speak_up.speak_to[pname].n_id
and (yl_speak_up.speak_to[pname].n_id)) then
minetest.show_formspec(pname, "yl_speak_up:edit_option_dialog",
yl_speak_up.get_fs_edit_option_dialog(player, n_id, d_id, trade.o_id))
return
end
local d_id = yl_speak_up.speak_to[pname].d_id
local n_id = yl_speak_up.speak_to[pname].n_id
-- if at least one successful trade has happened: show the target dialog
-- (else show the current dialog again)
if(trade.trade_done > 0) then