From 49386888c08704036292a51335aa297931b2cee0 Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Sat, 1 Jun 2024 02:03:04 +0200 Subject: [PATCH] Fix permset usage for allowed_items --- test.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test.lua b/test.lua index dda33fa..6630e56 100644 --- a/test.lua +++ b/test.lua @@ -37,7 +37,7 @@ function requestsDisplay() term.setTextColor(colors.orange) term.write("N/A") else - if allowed_items[val.answer.name] then + if permset.has(allowed_items, val.answer.name) then term.setTextColor(colors.green) else term.setTextColor(colors.yellow) @@ -47,7 +47,7 @@ function requestsDisplay() term.setTextColor(colors.white) term.setCursorPos(tw-4,line_num) term.write(" [") - if allowed_items[val.answer.name] then + if permset.has(allowed_items, val.answer.name) then term.setTextColor(colors.green) term.write("X") term.setTextColor(colors.white) @@ -182,10 +182,10 @@ function on_touch(touch_x, touch_y) end elseif current_tab == 1 and touch_x > tw-5 and display_list[touch_y] ~= nil then local item_name = display_list[touch_y] - if allowed_items[item_name] then - remove_allowed_item(item_name) + if permset.has(allowed_items, item_name) then + permset.remove(allowed_items, item_name) else - add_allowed_item(item_name) + permset.add(allowed_items, item_name) end return true end @@ -237,7 +237,7 @@ function get_requests() if have_it.name == it.name then found = true table.insert(requests, {req=req, answer=have_it}) - if left_amount > 0 and allowed_items[it.name] == true then + if left_amount > 0 and permset.has(allowed_items, it.name) then local export_amount = math.min(have_it.amount, left_amount) left_amount = left_amount - export_amount main_me.exportItem({name=it.name, count=export_amount}, config.main_me_inventory_side)