fix: fixes fluid tank handling
Forgot to unpack the table
This commit is contained in:
parent
5dcfcdf77f
commit
da0344ecb5
1 changed files with 10 additions and 2 deletions
|
|
@ -124,7 +124,11 @@ function getOrders ()
|
||||||
local orders = {}
|
local orders = {}
|
||||||
-- Oil
|
-- Oil
|
||||||
local oil_amt = table.remove(peripheral.call(OIL_TANK, "tanks"))
|
local oil_amt = table.remove(peripheral.call(OIL_TANK, "tanks"))
|
||||||
if oil_amt == nil then oil_amt = 0 end
|
if oil_amt == nil then
|
||||||
|
oil_amt = 0
|
||||||
|
else
|
||||||
|
oil_amt = oil_amt.amount
|
||||||
|
end
|
||||||
local oil_needed = OIL_SETPOINT - oil_amt
|
local oil_needed = OIL_SETPOINT - oil_amt
|
||||||
if oil_needed > 0 then orders.oil = oil_needed end
|
if oil_needed > 0 then orders.oil = oil_needed end
|
||||||
-- Biomass
|
-- Biomass
|
||||||
|
|
@ -136,7 +140,11 @@ function getOrders ()
|
||||||
-- Biofuel
|
-- Biofuel
|
||||||
-- TODO use up excess material?
|
-- TODO use up excess material?
|
||||||
local biofuel_amt = table.remove(peripheral.call(FUEL_TANK, "tanks"))
|
local biofuel_amt = table.remove(peripheral.call(FUEL_TANK, "tanks"))
|
||||||
if biofuel_amt == nil then biofuel_amt = 0 end
|
if biofuel_amt == nil then
|
||||||
|
biofuel_amt = 0
|
||||||
|
else
|
||||||
|
biofuel_amt = biofuel_amt.amount
|
||||||
|
end
|
||||||
local biofuel_needed = BIOFUEL_SETPOINT - biofuel_amt
|
local biofuel_needed = BIOFUEL_SETPOINT - biofuel_amt
|
||||||
if biofuel_needed > 0 then orders.biofuel = biofuel_needed end
|
if biofuel_needed > 0 then orders.biofuel = biofuel_needed end
|
||||||
return orders
|
return orders
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue