Skip to content

Commit ec54221

Browse files
authored
Merge pull request #1133 from Courseplay/1126-restarting-course-from-cp-menu-after-leaving-game
fix: start job without entering vehicle
2 parents 6ecf417 + 15b7149 commit ec54221

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

scripts/ai/jobs/CpAIJob.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ function CpAIJob:detectFieldBoundary()
263263
return false, false, g_i18n:getText("CP_error_not_on_field")
264264
end
265265
if vehicle:cpIsFieldBoundaryDetectionRunning() then
266-
return false, false, g_i18n:getText("CP_error_field_detection_still_running")
266+
return false, true, g_i18n:getText("CP_error_field_detection_still_running")
267267
end
268268
local x, z = vehicle:cpGetFieldPosition()
269269
if x == tx and z == tz then

scripts/ai/jobs/CpAIJobFieldWork.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,11 @@ function CpAIJobFieldWork:validate(farmId)
138138
end
139139
local vehicle = self.vehicleParameter:getVehicle()
140140

141-
--- Only check the valid field position in the in game menu.
141+
--- Only check the valid field boundary in the in game menu.
142142
if not self.isDirectStart then
143143
isValid, isRunning, errorMessage = self:detectFieldBoundary()
144-
if not isValid then
144+
if not isValid and not isRunning then
145+
self:debug("no boundary and no field detection is running");
145146
return isValid, errorMessage
146147
end
147148
self.cpJobParameters:validateSettings()

0 commit comments

Comments
 (0)