Skip to content

Commit

Permalink
Small mp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
schwiti6190 committed Apr 1, 2022
1 parent 2068e26 commit 30eb34e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/ai/jobs/CpAIJobBaleFinder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,19 @@ function CpAIJobBaleFinder:validate(farmId)
end

function CpAIJobBaleFinder:readStream(streamId, connection)
self.fieldPolygon = CustomField.readStreamVertices(streamId, connection)
self.baleFinderTask:setFieldPolygon(self.fieldPolygon)
if streamReadBool(streamId) then
self.fieldPolygon = CustomField.readStreamVertices(streamId, connection)
self.baleFinderTask:setFieldPolygon(self.fieldPolygon)
end
CpAIJobBaleFinder:superClass().readStream(self, streamId, connection)
end

function CpAIJobBaleFinder:writeStream(streamId, connection)
CustomField.writeStreamVertices(self.fieldPolygon, streamId, connection)
if self.fieldPolygon then
streamWriteBool(streamId, true)
CustomField.writeStreamVertices(self.fieldPolygon, streamId, connection)
else
streamWriteBool(streamId, false)
end
CpAIJobBaleFinder:superClass().writeStream(self, streamId, connection)
end

0 comments on commit 30eb34e

Please sign in to comment.