From 6f5a84e6de186167cfa4188175e7150b4ef581ef Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sun, 23 May 2021 23:24:21 +0200 Subject: [PATCH] handle edit mode in trade_simple correctly --- trade_simple.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/trade_simple.lua b/trade_simple.lua index afd7f4d..675f601 100644 --- a/trade_simple.lua +++ b/trade_simple.lua @@ -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