Skip to content

Commit b86f42f

Browse files
committed
Remove some path cleanup stuff that was creating worse paths
1 parent 41a1d84 commit b86f42f

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

Data/Base.rte/AI/HumanBehaviors.lua

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,30 +1425,6 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
14251425
ArrivedTimer:SetSimTimeLimitMS(0);
14261426
end
14271427
end
1428-
elseif WptList[2] then -- check if some other waypoint is closer
1429-
local test = math.random(1, math.min(10, #WptList));
1430-
local RandomWpt = WptList[test];
1431-
if RandomWpt then
1432-
Dist = SceneMan:ShortestDistance(Owner.Pos, RandomWpt.Pos, false);
1433-
if Dist:MagnitudeIsLessThan(50) and Dist:MagnitudeIsLessThan(SceneMan:ShortestDistance(Owner.Pos, Waypoint.Pos, false).Magnitude * 0.33) then
1434-
-- this waypoint is closer, check LOS
1435-
if -1 == SceneMan:CastObstacleRay(Owner.Pos, Dist, Vector(), Vector(), Owner.ID, Owner.IgnoresWhichTeam, rte.grassID, 4) then
1436-
Waypoint = RandomWpt; -- go here instead
1437-
if WptList[test-1] then
1438-
PrevWptPos = Vector(WptList[test-1].Pos.X, WptList[test-1].Pos.Y);
1439-
else
1440-
PrevWptPos = Vector(Owner.Pos.X, Owner.Pos.Y);
1441-
end
1442-
1443-
for _ = 1, test do -- delete the earlier waypoints
1444-
table.remove(WptList, 1);
1445-
if WptList[1] then
1446-
Owner:RemoveMovePathBeginning();
1447-
end
1448-
end
1449-
end
1450-
end
1451-
end
14521428
end
14531429

14541430
if Waypoint then

0 commit comments

Comments
 (0)