From b70c72c53516085759e20503462f3c7563bbad03 Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Sat, 1 Jun 2024 01:48:24 +0200 Subject: [PATCH] Fix duplicate variable name --- test.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test.lua b/test.lua index b41d104..dda33fa 100644 --- a/test.lua +++ b/test.lua @@ -255,11 +255,11 @@ end function get_orders() orders = {} - local orders = colony.getWorkOrders() - if orders ~= nil then - for i, order in pairs(orders) do - local res = colony.getWorkOrderResources(order.id) - table.insert(orders, {id=order.id, type=order.workOrderType, target=order.type, pos=order.builder, item=res.item, claimed=order.isClaimed, delivering=res.delivering}) + local colony_orders = colony.getWorkOrders() + if colony_orders ~= nil then + for i, wo in pairs(colony_orders) do + local res = colony.getWorkOrderResources(wo.id) + table.insert(orders, {id=wo.id, type=wo.workOrderType, target=wo.type, pos=wo.builder, resources=res, claimed=wo.isClaimed, delivering=res.delivering}) wait_for(config.step_sleep_time) end end