Skip to content

Commit ff8cad9

Browse files
committed
doc: PREPARING phase explanation comments
1 parent 2173159 commit ff8cad9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

scripts/ai/strategies/AIDriveStrategyFieldWorkCourse.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ function AIDriveStrategyFieldWorkCourse:getDriveData(dt, vX, vY, vZ)
157157
end
158158
----------------------------------------------------------------
159159
if self.state == self.states.INITIAL then
160+
-- We need a separate phase for preparing to make sure that the
161+
-- * onAIFieldWorkerStart,
162+
-- * onAIFieldWorkerPrepareForWork,
163+
-- * onAIImplementStartLine
164+
-- events are generated one by one, one in each update loop so that at the end of the loop,
165+
-- AIFieldWorker:updateAIFieldWorker() triggers a onAIFieldWorkerActive event.
166+
-- This makes sure that all implements are lowered and started correctly in multiplayer as well.
160167
self:setMaxSpeed(0)
161168
self:prepareForFieldWork()
162169
self.state = self.states.PREPARING

0 commit comments

Comments
 (0)