fix: forsynings-diagnose robust (pcall, varekatalog uden metode) (v1.62.92)
This commit is contained in:
@@ -806,7 +806,7 @@ local function logSupplyMiss(driver, ranked, bestFood, markerStations, farmId)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local fillType = g_fillTypeManager ~= nil and g_fillTypeManager:getFillTypeByIndex(need.fillType) or nil
|
local fillType = g_fillTypeManager ~= nil and g_fillTypeManager.getFillTypeByIndex ~= nil and g_fillTypeManager:getFillTypeByIndex(need.fillType) or nil
|
||||||
table.insert(parts, string.format("%s: fri %.0f l, %s, %d kilder med lager (bedst %.0f l), %d beskyttet produktionsinput",
|
table.insert(parts, string.format("%s: fri %.0f l, %s, %d kilder med lager (bedst %.0f l), %d beskyttet produktionsinput",
|
||||||
fillType ~= nil and fillType.name or tostring(need.fillType), need.freeSpace or 0,
|
fillType ~= nil and fillType.name or tostring(need.fillType), need.freeSpace or 0,
|
||||||
allowed and "tilladt" or "IKKE tilladt (bedre foder findes)", withStock, bestLevel, protected))
|
allowed and "tilladt" or "IKKE tilladt (bedre foder findes)", withStock, bestLevel, protected))
|
||||||
@@ -871,7 +871,8 @@ function ADSmartPickup.findSupplyPickup(adEnv, driver, ingredients, targetWayPoi
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
logSupplyMiss(driver, ranked, bestFood, markerStations, farmId)
|
local okLog, errLog = pcall(logSupplyMiss, driver, ranked, bestFood, markerStations, farmId)
|
||||||
|
if not okLog then Logging.warning(ADSmartPickup.LOG_PREFIX .. "forsynings-diagnose: %s", tostring(errLog)) end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user