Skip to content

Commit

Permalink
Do not remember selected helper type, make an educated guess for the …
Browse files Browse the repository at this point in the history
…desired helper type instead.

Reverts #24
  • Loading branch information
ThomasMatern committed Dec 29, 2024
1 parent 4e91e2a commit 25f8d4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
13 changes: 3 additions & 10 deletions scripts/Modules/StateModule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ function ADStateModule:reset()

self.startHelper = false

if self.vehicle.getLastJob then
self.usedHelper = ADStateModule.HELPER_AI
elseif self.vehicle.cpStartStopDriver then
if self.vehicle.cpStartStopDriver then
self.usedHelper = ADStateModule.HELPER_CP
elseif self.vehicle.acParameters then
self.usedHelper = ADStateModule.HELPER_AIVE
elseif self.vehicle.getLastJob then
self.usedHelper = ADStateModule.HELPER_AI
else
self.usedHelper = ADStateModule.HELPER_NONE
end
Expand Down Expand Up @@ -172,12 +172,6 @@ function ADStateModule:readFromXMLFile(xmlFile, key)
self.bunkerUnloadType = bunkerUnloadType
end

local usedHelper = xmlFile:getValue(key .. "#usedHelper")
if usedHelper ~= nil and self:isHelperTypeValid(usedHelper) then
self.usedHelper = usedHelper
end


-- local automaticUnloadTarget = xmlFile:getValue(key .. "#automaticUnloadTarget")
-- if automaticUnloadTarget ~= nil then
-- self.automaticUnloadTarget = automaticUnloadTarget
Expand Down Expand Up @@ -206,7 +200,6 @@ function ADStateModule:saveToXMLFile(xmlFile, key)
xmlFile:setValue(key .. "#driverName", self.driverName)
xmlFile:setValue(key .. "#lastActive", self.active)
xmlFile:setValue(key .. "#AIVElastActive", false)
xmlFile:setValue(key .. "#usedHelper", self.usedHelper)
xmlFile:setValue(key .. "#bunkerUnloadType", self.bunkerUnloadType)
-- xmlFile:setValue(key .. "#automaticUnloadTarget", self.automaticUnloadTarget)
-- xmlFile:setValue(key .. "#automaticPickupTarget", self.automaticPickupTarget)
Expand Down
1 change: 0 additions & 1 deletion scripts/Specialization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ function AutoDrive.initSpecialization()
schemaSavegame:register(XMLValueType.STRING, "vehicles.vehicle(?).AutoDrive#driverName", "driverName")
schemaSavegame:register(XMLValueType.BOOL, "vehicles.vehicle(?).AutoDrive#lastActive", "lastActive")
schemaSavegame:register(XMLValueType.BOOL, "vehicles.vehicle(?).AutoDrive#AIVElastActive", "AIVElastActive")
schemaSavegame:register(XMLValueType.INT, "vehicles.vehicle(?).AutoDrive#usedHelper", "usedHelper")
schemaSavegame:register(XMLValueType.INT, "vehicles.vehicle(?).AutoDrive#parkDestination", "parkDestination")
schemaSavegame:register(XMLValueType.INT, "vehicles.vehicle(?).AutoDrive#bunkerUnloadType", "bunkerUnloadType")
if AutoDrive.automaticUnloadTarget then
Expand Down

0 comments on commit 25f8d4d

Please sign in to comment.