From 5381dfccbc689eec3aca21f7ebffa419bb539e72 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Wed, 2 Jun 2021 01:32:06 +0200 Subject: [PATCH] show 'Sold out' for the right trade --- trade_list.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trade_list.lua b/trade_list.lua index dbbba00..e1a7c0d 100644 --- a/trade_list.lua +++ b/trade_list.lua @@ -132,15 +132,15 @@ yl_speak_up.get_fs_trade_list = function(player, show_dialog_option_trades) "gui_furnace_arrow_bg.png^[transformR270;"..kstr..";]".. "item_image_button["..tostring(2.6+(col*4))..","..tostring(1+row)..";1,1;".. tostring(v.buy[1])..";"..kstr..";]") + if(not(npc_inv:contains_item("npc_main", buy_stack))) then + table.insert(formspec, + "label["..tostring(1.7+(col*4))..","..tostring(1.2+row)..";Sold out]") + end row = row + 1 if(row > yl_speak_up.trade_max_rows) then row = 0 col = col + 1 end - if(not(npc_inv:contains_item("npc_main", buy_stack))) then - table.insert(formspec, - "label["..tostring(1.7+(col*4))..","..tostring(0.2+row)..";Sold out]") - end end end