You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
coroutine.yield(); -- wait until all paths are complete
501
+
end
497
502
503
+
fork, LZinpairs(GoodLZs) do
504
+
pathRequest=completedPathRequests[k];
505
+
ifpathRequest.PathLength>-1then
498
506
localNextWpt, PrevWpt, deltaY;
499
507
localheight=0;
500
-
localpathLength=0;
501
508
localpathObstMaxHeight=0;
502
509
503
-
for_, Wptinpairs(Path) do
504
-
pathLength=pathLength+1;
510
+
forWptinpathRequest.Pathdo
505
511
NextWpt=SceneMan:MovePointToGround(Wpt, 20, 12);
506
512
507
513
ifPrevWptthen
@@ -519,36 +525,27 @@ function LandingZoneMap.SearchForLZ(self, team, Destination, digStrenght)
519
525
end
520
526
521
527
PrevWpt=NextWpt;
522
-
ifpathLength%17==0then
523
-
coroutine.yield(); -- wait until the next frame
524
-
end
525
528
end
526
529
527
530
GoodLZs[k].terrainScore=LZ.score;
528
-
GoodLZs[k].pathLength=pathLength;
531
+
GoodLZs[k].pathLength=pathRequest.PathLength;
529
532
GoodLZs[k].pathObstMaxHeight=pathObstMaxHeight;
530
-
GoodLZs[k].score=LZ.score- (pathLength*0.2+math.floor(pathObstMaxHeight/15) *12); -- recalculate the score so we can find a safe LZ that has an easy path to the destination
533
+
GoodLZs[k].score=LZ.score- (pathRequest.PathLength*0.2+math.floor(pathObstMaxHeight/15) *12); -- recalculate the score so we can find a safe LZ that has an easy path to the destination
531
534
else
532
535
-- unknown path
533
536
GoodLZs[k].terrainScore=LZ.score;
534
537
GoodLZs[k].pathLength=200;
535
538
GoodLZs[k].pathObstMaxHeight=200;
536
539
GoodLZs[k].score=LZ.score-100;
537
540
end
538
-
539
-
coroutine.yield(); -- wait until the next frame
540
541
end
541
542
542
-
coroutine.yield(); -- wait until the next frame
543
-
544
543
table.sort(GoodLZs, function(A, B) returnA.score>B.scoreend); -- the best LZ first
0 commit comments