diff --git a/fs_talkdialog.lua b/fs_talkdialog.lua index f43bcd7..cbbea61 100644 --- a/fs_talkdialog.lua +++ b/fs_talkdialog.lua @@ -893,8 +893,8 @@ yl_speak_up.get_fs_talkdialog = function(player, n_id, d_id, alternate_text, rec -- add a Let's trade button to the first dialog if the NPC has trades + local has_trades = nil if(is_a_start_dialog and dialog.trades) then - local has_trades = nil for k, v in pairs(dialog.trades) do -- has the NPC any *public* trades that are not effects/results? if(not(v.hide) and not(v.d_id)) then @@ -902,6 +902,8 @@ yl_speak_up.get_fs_talkdialog = function(player, n_id, d_id, alternate_text, rec break end end + end + if(has_trades) then h = yl_speak_up.add_edit_button_fs_talkdialog(formspec, h, "show_trade_list", "Show a list of trades the NPC has to offer.",