From 1c95cad34aa4740d25a982998ce513c5db08f7f4 Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Thu, 22 Dec 2022 10:48:42 +0100 Subject: [PATCH] Fixed issue with nil fuels. --- src/movescript.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/movescript.lua b/src/movescript.lua index c63e816..534e2a1 100644 --- a/src/movescript.lua +++ b/src/movescript.lua @@ -115,11 +115,13 @@ local function refuelAll(settings) local refueled = false for slot = 1, 16 do local item = t.getItemDetail(slot) - for _, fuelName in pairs(fuels) do - if item.name == fuelName then - t.select(i) - if t.refuel(item.count) then refueled = true end - break + if item ~= nil then + for _, fuelName in pairs(fuels) do + if item.name == fuelName then + t.select(i) + if t.refuel(item.count) then refueled = true end + break + end end end end