Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Push Release 6.4.1.3
Browse files Browse the repository at this point in the history
fixes
Mode9 (and others) cause Memory Overflow when workWidth is 0 #7588
fixes
Mode 10, Bunker Silo filling/compacting | Shield Working Width #7593 loading of saved workwidth
fixes
Issue with John Deere 50G Crawler Compact Excavator #7610
  • Loading branch information
Tensuko authored Nov 7, 2021
2 parents d37ac25 + 8c4f253 commit afaed0f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion BunkerSiloAIDriver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function BunkerSiloAIDriver:isHeapSearchAllowed()
end

function BunkerSiloAIDriver:getWorkWidth()
return self.courseGeneratorSettings.workWidth:get()
return math.max(self.courseGeneratorSettings.workWidth:get(),3)
end

--- If true then the drive into silo course is reverse and
Expand Down
3 changes: 3 additions & 0 deletions base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ function courseplay:onUpdate(dt)
---set correctly at the first courseplay:setAIDriver() call.
self.cp.driver:postInit()
end
--- The saved value gets applied, before all implements are attached.
--- So only allow automatic changes after all implements are attached on savegame start.
self.cp.courseGeneratorSettings.workWidth:postInit()
self.cp.settings.driverMode:postInit()
--- Refreshes all field number settings on start,
--- as clients might have a corrupted version.
Expand Down
15 changes: 13 additions & 2 deletions course-generator/CourseGeneratorSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,20 @@ function WorkWidthSetting:init(vehicle)
-- and parentName is not set.
-- TODO: move creating the course gen (or others too?) settings to onPostLoad() (instead of onLoad())
-- TODO: add parentName to the constructor of the settings instead of the explicit setter.
self:setToDefault(true)
self:refresh()
self.WORK_WIDTH_EVENT = self:registerFloatEvent(self.setWorkWidthFromNetwork)
self.AUTO_WORK_WIDTH_EVENT = self:registerFloatEvent(self.setAutoWorkWidthFromNetwork)
if g_server then
self:updateAutoWorkWidth()
self:setToDefault(true)
end
self.loaded = false
end

--- The saved value gets applied, before all implements are attached.
--- So only allow automatic changes after all implements are attached on savegame start.
function WorkWidthSetting:postInit()
self.loaded = true
end

function WorkWidthSetting:loadFromXml(xml, parentKey)
Expand Down Expand Up @@ -234,9 +241,13 @@ end
--- so we update it on a attach/detach of an implement and
--- send the changed value with an event to the client.
function WorkWidthSetting:updateAutoWorkWidth()
if g_server == nil then return end
local value = WorkWidthUtil.getAutomaticWorkWidth(self.vehicle) or 0
self.automaticValue:set(value,true)
self.value:set(value,true)
if self.loaded then
self.value:set(value,true)
end
self:refresh()
self:sendAutoWorkWidthEvent(value)
end

Expand Down
2 changes: 1 addition & 1 deletion modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="53">
<version>6.4.1.2</version>
<version>6.4.1.3</version>
<author><![CDATA[Courseplay.devTeam]]></author>
<title>
<en>CoursePlay</en>
Expand Down
2 changes: 1 addition & 1 deletion toolManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ end
---@param object table
---@param logPrefix string
function WorkWidthUtil.getShieldWorkWidth(object,logPrefix)
if object.spec_leveler then
if object.spec_leveler and object.spec_leveler.nodes and object.spec_leveler.nodes[1] and object.spec_leveler.nodes[1].maxDropWidth then
local width = object.spec_leveler.nodes[1].maxDropWidth * 2
WorkWidthUtil.debug(object,logPrefix,'is a shield with work width: %.1f',width)
return width
Expand Down

0 comments on commit afaed0f

Please sign in to comment.