Skip to content

Commit

Permalink
fix: callstack in shop while selecting other variant
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Vaiko committed Dec 9, 2024
1 parent 7896a2d commit 1bdde1e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/specializations/CpCourseManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,18 @@ end

function CpCourseManager:addCourse(course,noEventSend)
local spec = self.spec_cpCourseManager
-- reset temporary offset field course, this will be regenerated based on the current settings when the job starts
spec.offsetFieldWorkCourse = nil
course:setVehicle(self)
table.insert(spec.courses,course)
SpecializationUtil.raiseEvent(self,"onCpCourseChange",course,noEventSend)
end

function CpCourseManager:resetCourses()
local spec = self.spec_cpCourseManager
spec.offsetFieldWorkCourse = nil
spec.courses = {}
spec.assignedCoursesID = nil
SpecializationUtil.raiseEvent(self,"onCpCourseChange")
if spec.courses then
spec.courses = {}
spec.assignedCoursesID = nil
SpecializationUtil.raiseEvent(self,"onCpCourseChange")
end
end

function CpCourseManager:resetCpCoursesFromGui()
Expand Down

0 comments on commit 1bdde1e

Please sign in to comment.