@@ -452,8 +452,8 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
452
452
453
453
if Owner .Jetpack and Owner .Head and Owner .Head :IsAttached () then
454
454
if Owner .Jetpack .JetTimeLeft < AI .minBurstTime then
455
- AI .jump = false ; -- not enough fuel left, no point in jumping yet
456
455
if not AI .flying or Owner .Vel .Y > 4 then
456
+ AI .jump = false ; -- not enough fuel left, no point in jumping yet
457
457
AI .refuel = true ;
458
458
end
459
459
else
@@ -522,7 +522,7 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
522
522
end
523
523
524
524
-- predict jetpack movement...
525
- local jetStrength = AI .jetImpulseFactor / Owner .Mass ;
525
+ local jetStrength = ( AI .jetImpulseFactor / Owner .Mass ) ;
526
526
local t = math.min (0.4 , Owner .Jetpack .JetTimeLeft * 0.001 );
527
527
local PixelVel = Owner .Vel * (GetPPM () * t );
528
528
local Accel = SceneMan .GlobalAcc * GetPPM ();
@@ -535,34 +535,29 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
535
535
-- when jumping (check four directions)
536
536
for k , Face in pairs (Facings ) do
537
537
local JetAccel = Vector (- jetStrength , 0 ):RadRotate (Owner .RotAngle + 1.375 * math.pi + Face .facing * 0.25 );
538
- local JumpPos = Owner .Head . Pos + PixelVel + (Accel + JetAccel ) * (t * t * 0.5 );
538
+ local JumpPos = Owner .Pos + PixelVel + (Accel + JetAccel ) * (t * t * 0.5 );
539
539
540
540
-- a burst add a one time boost to acceleration
541
541
if Owner .Jetpack :CanTriggerBurst () then
542
542
JumpPos = JumpPos + Vector (- AI .jetBurstFactor , 0 ):AbsRotateTo (JetAccel );
543
543
end
544
544
545
545
-- check for obstacles from the head
546
- Trace = SceneMan :ShortestDistance (Owner .Head .Pos , JumpPos , false );
547
- local obstDist = SceneMan :CastObstacleRay (Owner .Head .Pos , Trace , JumpPos , Vector (), Owner .ID , Owner .IgnoresWhichTeam , rte .grassID , 3 );
548
- if obstDist < 0 then -- no obstacles: calculate the distance from the future pos to the wpt
549
- Facings [k ].range = SceneMan :ShortestDistance (Waypoint .Pos , JumpPos , false ).Magnitude ;
550
- else -- the ray hit terrain or start inside terrain: avoid
551
- Facings [k ].range = SceneMan :ShortestDistance (Waypoint .Pos , JumpPos , false ).Largest * 2 ;
552
- end
546
+ Trace = SceneMan :ShortestDistance (Owner .Pos , JumpPos , false );
547
+ Facings [k ].range = SceneMan :ShortestDistance (Waypoint .Pos , JumpPos , false ).Magnitude ;
553
548
end
554
549
555
550
-- when falling or walking
556
- local FallPos = Owner .Head . Pos + PixelVel ;
551
+ local FallPos = Owner .Pos + PixelVel ;
557
552
if AI .flying then
558
553
FallPos = FallPos + Accel * (t * t * 0.5 );
559
554
end
560
555
561
556
-- check for obstacles when falling/walking
562
- local Trace = SceneMan :ShortestDistance (Owner .Head . Pos , FallPos , false );
563
- SceneMan :CastObstacleRay (Owner .Head . Pos , Trace , FallPos , Vector (), Owner .ID , Owner .IgnoresWhichTeam , rte .grassID , 3 );
557
+ local Trace = SceneMan :ShortestDistance (Owner .Pos , FallPos , false );
558
+ SceneMan :CastObstacleRay (Owner .Pos , Trace , FallPos , Vector (), Owner .ID , Owner .IgnoresWhichTeam , rte .grassID , 3 );
564
559
565
- local deltaToJump = 15 ;
560
+ local deltaToJump = 1 ;
566
561
if Owner .Jetpack .JetpackType == AEJetpack .JumpPack then
567
562
deltaToJump = deltaToJump * 1.4 ;
568
563
end
0 commit comments