From: Olav Bakke Svendsen Date: Wed, 11 Oct 2023 21:39:39 +0000 (+0200) Subject: Getting verbose, this X-Git-Tag: stable-steam~33 X-Git-Url: http://git.olavbs.no/?a=commitdiff_plain;h=130f10aa20d106ed3b94e45f91009028285a87ab;p=cc.git Getting verbose, this --- diff --git a/steam/temporary-coal-feeder.lua b/steam/temporary-coal-feeder.lua index 8bf7a48..86aac3e 100644 --- a/steam/temporary-coal-feeder.lua +++ b/steam/temporary-coal-feeder.lua @@ -23,7 +23,7 @@ local locate_coal = function() local stock = {} for addr,barrel in pairs(barrels) do local item = barrel.getItemDetail(1) - stock[addr] = item.count or 0 + stock[addr] = item and item.count or 0 end return stock end @@ -32,7 +32,7 @@ local feed = function(stock) local stock = stock for deployer_addr,deployer in pairs(deployers) do local deployer_item = deployer.getItemDetail(1) - if refill_when(deployer_item.count or 0) then + if refill_when(deployer_item and deployer_item.count or 0) then local f = function() return false, "No coal available" end for barrel_addr,count in pairs(stock) do if count >= refill_amt then