@@ -1295,6 +1295,7 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
1295
1295
end
1296
1296
else
1297
1297
local updateInterval = SettingsMan .AIUpdateInterval ;
1298
+
1298
1299
-- Try swapping direction, with a 15% random chance per tick while we're stuck
1299
1300
if PosRand () > (1 - 0.15 ) / updateInterval then
1300
1301
nextLatMove = AI .lateralMoveState == Actor .LAT_LEFT and Actor .LAT_RIGHT or Actor .LAT_LEFT ;
@@ -1306,7 +1307,7 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
1306
1307
end
1307
1308
1308
1309
-- refuelling done
1309
- if AI .refuel and Owner .Jetpack and Owner .Jetpack .JetTimeLeft >= Owner .Jetpack .JetTimeTotal * 0.99 then
1310
+ if AI .refuel and Owner .Jetpack and Owner .Jetpack .JetpackType == AEJetpack . Standard and Owner . Jetpack . JetTimeLeft >= Owner .Jetpack .JetTimeTotal * 0.99 then
1310
1311
AI .jump = true ;
1311
1312
end
1312
1313
end
@@ -1770,7 +1771,7 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
1770
1771
-- do we have a target we want to shoot at?
1771
1772
if (AI .Target and AI .canHitTarget and AI .BehaviorName ~= " AttackTarget" ) then
1772
1773
-- are we also flying
1773
- if AI .flying then
1774
+ if AI .flying and Owner . Jetpack . JetpackType == AEJetpack . Standard then
1774
1775
-- predict jetpack movement when jumping and there is a target (check one direction)
1775
1776
local jetStrength = AI .jetImpulseFactor / Owner .Mass ;
1776
1777
local t = math.min (0.4 , Owner .Jetpack .JetTimeLeft * 0.001 );
@@ -1816,7 +1817,7 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
1816
1817
AI .jump = false ;
1817
1818
end
1818
1819
else
1819
- if Waypoint .Type ~= " drop" and not Lower (Waypoint , Owner , 20 ) then
1820
+ if Waypoint .Type ~= " drop" and not Lower (Waypoint , Owner , 20 ) and Owner . Jetpack . JetpackType == AEJetpack . Standard then
1820
1821
-- jump over low obstacles unless we want to jump off a ledge
1821
1822
if nextLatMove == Actor .LAT_RIGHT and (Obstacles [Obst .R_LOW ] or Obstacles [Obst .R_FRONT ]) and not Obstacles [Obst .R_UP ] then
1822
1823
AI .jump = true ;
@@ -1872,11 +1873,16 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
1872
1873
local Trace = SceneMan :ShortestDistance (Owner .Head .Pos , FallPos , false );
1873
1874
SceneMan :CastObstacleRay (Owner .Head .Pos , Trace , FallPos , Vector (), Owner .ID , Owner .IgnoresWhichTeam , rte .grassID , 3 );
1874
1875
1876
+ local deltaToJump = 25 ;
1877
+ if Owner .Jetpack .JetpackType == AEJetpack .JumpPack then
1878
+ deltaToJump = deltaToJump * 1.4 ;
1879
+ end
1880
+
1875
1881
table.sort (Facings , function (A , B ) return A .range < B .range end );
1876
1882
local delta = SceneMan :ShortestDistance (Waypoint .Pos , FallPos , false ).Magnitude - Facings [1 ].range ;
1877
1883
if delta < 1 then
1878
1884
AI .jump = false ;
1879
- elseif AI .flying or delta > 25 then
1885
+ elseif delta > deltaToJump or ( AI .flying and Owner . Jetpack . JetpackType == AEJetpack . Standard ) then
1880
1886
AI .jump = true ;
1881
1887
nextAimAngle = Owner :GetAimAngle (false ) * 0.5 + Facings [1 ].aim * 0.5 ; -- adjust jetpack nozzle direction
1882
1888
nextLatMove = Actor .LAT_STILL ;
0 commit comments