Skip to content

Commit 72593af

Browse files
committed
A couple fixes to automover controllers
Remove debug circle drawing (oops)
1 parent c8118e7 commit 72593af

File tree

1 file changed

+4
-3
lines changed
  • Data/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Automovers/Controller

1 file changed

+4
-3
lines changed

Data/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Automovers/Controller/Controller.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ automoverActorFunctions.setupActorWaypointData = function(self, actorData)
10711071

10721072
waypointData.previousNode = self:findClosestNode(actor.Pos, nil, true, true, false, nil);
10731073
if not waypointData.previousNode then
1074-
self:removeActorFromAutomoverTable(actor);
1074+
self:setActorMovementModeToLeaveAutomovers(actorData);
10751075
return;
10761076
end
10771077
local targetPosition = waypointData.movableObjectTarget ~= nil and waypointData.movableObjectTarget.Pos or waypointData.sceneTargets[1];
@@ -1321,9 +1321,10 @@ automoverActorFunctions.handleActorThatHasReachedItsEndNode = function(self, act
13211321
local distanceFromActorToFirstExitPathPosition = SceneMan:ShortestDistance(waypointData.exitPath[1], actor.Pos, self.checkWrapping);
13221322
if distanceFromActorToFirstExitPathPosition:MagnitudeIsLessThan(20) then
13231323
table.remove(waypointData.exitPath, 1);
1324-
local distanceFromActorToFirstExitPathPosition = SceneMan:ShortestDistance(waypointData.exitPath[1], actor.Pos, self.checkWrapping);
1324+
if #waypointData.exitPath > 0 then
1325+
local distanceFromActorToFirstExitPathPosition = SceneMan:ShortestDistance(waypointData.exitPath[1], actor.Pos, self.checkWrapping);
1326+
end
13251327
end
1326-
PrimitiveMan:DrawCircleFillPrimitive(0, waypointData.exitPath[1], 10, 7)
13271328
actorData.direction = getDirectionForDistanceLargerAxis(distanceFromActorToFirstExitPathPosition, 0);
13281329

13291330
local endNodeData = teamNodeTable[waypointData.endNode];

0 commit comments

Comments
 (0)