Skip to content

Commit

Permalink
Small mp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
schwiti6190 committed Mar 9, 2022
1 parent 00a90ac commit 7be0f28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scripts/ai/tasks/CpAITaskDriveTo.lua
Expand Up @@ -11,8 +11,10 @@ function CpAITaskDriveTo:setVehicle(vehicle)
end

function CpAITaskDriveTo:start()
CpUtil.infoVehicle(self.vehicle, 'CP drive to task started')
self.vehicle:startCpDriveTo(self, self.job:getCpJobParameters())
if self.isServer then
CpUtil.infoVehicle(self.vehicle, 'CP drive to task started')
self.vehicle:startCpDriveTo(self, self.job:getCpJobParameters())
end
end

function CpAITaskDriveTo:update()
Expand Down
2 changes: 1 addition & 1 deletion scripts/specializations/CpAIWorker.lua
Expand Up @@ -221,7 +221,7 @@ function CpAIWorker:stopCpDriveTo()
end

function CpAIWorker:onUpdate(dt)
if self.driveToFieldWorkStartStrategy then
if self.isServer and self.driveToFieldWorkStartStrategy then
if self.driveToFieldWorkStartStrategy:isWorkStartReached() then
CpUtil.debugVehicle(CpDebug.DBG_FIELDWORK, self, 'Work start location reached')
self.driveToTask:onTargetReached()
Expand Down

0 comments on commit 7be0f28

Please sign in to comment.