Skip to content

Commit f207ff8

Browse files
committed
Tweaks to exiting automover area
1 parent f39d061 commit f207ff8

File tree

1 file changed

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

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ automoverActorFunctions.setupActorWaypointData = function(self, actorData)
10811081
waypointData.actorReachedTargetInsideAutomoverArea = false;
10821082
waypointData.actorReachedEndNodeForTargetOutsideAutomoverArea = false;
10831083
waypointData.teleporterVisualsTimer = Timer(1000);
1084-
waypointData.delayTimer = Timer(50);
1084+
waypointData.delayTimer = Timer(30);
10851085

10861086
waypointData.endNode = self:findClosestNode(waypointData.targetPosition, waypointData.previousNode, false, waypointData.targetIsInsideAutomoverArea, true, actor.Team);
10871087
if not waypointData.endNode then
@@ -1317,7 +1317,7 @@ automoverActorFunctions.handleActorThatHasReachedItsEndNode = function(self, act
13171317
end
13181318
end
13191319
waypointData.delayTimer:Reset();
1320-
elseif waypointData.exitPath ~= nil and #waypointData.exitPath > 0 then
1320+
elseif waypointData.exitPath ~= nil and #waypointData.exitPath > 0 and waypointData.delayTimer:IsPastSimTimeLimit() then
13211321
local distanceFromActorToFirstExitPathPosition = SceneMan:ShortestDistance(waypointData.exitPath[1], actor.Pos, self.checkWrapping);
13221322
if distanceFromActorToFirstExitPathPosition:MagnitudeIsLessThan(20) then
13231323
table.remove(waypointData.exitPath, 1);
@@ -1329,7 +1329,12 @@ automoverActorFunctions.handleActorThatHasReachedItsEndNode = function(self, act
13291329

13301330
local endNodeData = teamNodeTable[waypointData.endNode];
13311331
if not endNodeData.zoneBox:IsWithinBox(waypointData.exitPath[1]) and (endNodeData.connectedNodeData[actorData.direction] == nil or not endNodeData.connectingAreas[actorData.direction]:IsInside(waypointData.exitPath[1])) then
1332-
actor.Vel = actor.Vel + (distanceFromActorToFirstExitPathPosition.Normalized:FlipX(true):FlipY(true) * self.movementAcceleration * 10);
1332+
local velocityToAddToActor = distanceFromActorToFirstExitPathPosition.Normalized:FlipX(true):FlipY(true) * self.movementAcceleration * 10;
1333+
if math.abs(velocityToAddToActor.X) < 1 and velocityToAddToActor.Y < 0 and SceneMan.GlobalAcc.Y > 0 then
1334+
velocityToAddToActor.Y = velocityToAddToActor.Y * 2;
1335+
end
1336+
actor.Vel = actor.Vel + velocityToAddToActor;
1337+
13331338
end
13341339
waypointData.delayTimer:Reset();
13351340
end

0 commit comments

Comments
 (0)