From b005c367b8a5497fee0ff4c1df06371a629a04a7 Mon Sep 17 00:00:00 2001 From: Stephan Schlosser Date: Mon, 3 Jun 2019 15:59:06 +0200 Subject: [PATCH] Bugfix in TrailerUtil probably caused by adding more trigger types, such as the bunkerSilo --- FS19_AutoDrive/scripts/AutoDriveTrailerUtil.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/FS19_AutoDrive/scripts/AutoDriveTrailerUtil.lua b/FS19_AutoDrive/scripts/AutoDriveTrailerUtil.lua index d5dff9c0..ad83bc3a 100644 --- a/FS19_AutoDrive/scripts/AutoDriveTrailerUtil.lua +++ b/FS19_AutoDrive/scripts/AutoDriveTrailerUtil.lua @@ -116,11 +116,13 @@ function AutoDrive:handleTrailers(vehicle, dt) for _,trailer in pairs(trailers) do for _,trigger in pairs(AutoDrive.Triggers.siloTriggers) do local activate = false; - for __,fillableObject in pairs(trigger.fillableObjects) do - if fillableObject.object == trailer then - activate = true; - end; - end; + if trigger.fillableObjects ~= nil then + for __,fillableObject in pairs(trigger.fillableObjects) do + if fillableObject.object == trailer then + activate = true; + end; + end; + end; if AutoDrive:getSetting("continueOnEmptySilo") and vehicle.ad.isLoading and vehicle.ad.isPaused and not trigger.isLoading and vehicle.ad.startedLoadingAtTrigger then --trigger must be empty by now. Drive on! vehicle.ad.isPaused = false; vehicle.ad.isUnloading = false; @@ -246,4 +248,4 @@ function AutoDrive:getTrailersOfImplement(attachedImplement) end; return; -end; \ No newline at end of file +end;