Skip to content

Commit fac0568

Browse files
committed
Increase fuel instead of thrust for AI
1 parent dd3527b commit fac0568

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Data/Base.rte/AI/NativeHumanAI.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ function NativeHumanAI:Create(Owner)
5353
-- the native AI assume the jetpack cannot be destroyed
5454
if Owner.Jetpack then
5555
if not Members.isPlayerOwned then
56-
Owner.Jetpack.Throttle = Owner.Jetpack.Throttle + 0.15 -- increase jetpack strength slightly to compensate for AI ineptitude
56+
Owner.Jetpack.JetTimeTotal = Owner.Jetpack.JetTimeTotal * 1.2; -- increase jetpack fuel to compensate for extra fuel spend
5757
end
5858

59-
Members.jetImpulseFactor = Owner.Jetpack:EstimateImpulse(false) * GetPPM() / TimerMan.DeltaTimeSecs;
60-
Members.jetBurstFactor = (Owner.Jetpack:EstimateImpulse(true) * GetPPM() / TimerMan.DeltaTimeSecs - Members.jetImpulseFactor) * math.pow(TimerMan.DeltaTimeSecs, 2) * 0.5;
6159
Members.minBurstTime = math.min(Owner.Jetpack.BurstSpacing*2, Owner.Jetpack.JetTimeTotal*0.99); -- in milliseconds
6260
end
6361

@@ -69,6 +67,12 @@ end
6967
function NativeHumanAI:Update(Owner)
7068
self.Ctrl = Owner:GetController();
7169

70+
-- Our jetpack might have thrust balancing enabled, so update for our current mass
71+
if Owner.Jetpack then
72+
Members.jetImpulseFactor = Owner.Jetpack:EstimateImpulse(false) * GetPPM() / TimerMan.DeltaTimeSecs;
73+
Members.jetBurstFactor = (Owner.Jetpack:EstimateImpulse(true) * GetPPM() / TimerMan.DeltaTimeSecs - Members.jetImpulseFactor) * math.pow(TimerMan.DeltaTimeSecs, 2) * 0.5;
74+
end
75+
7276
if self.isPlayerOwned then
7377
if self.PlayerInterferedTimer:IsPastSimTimeLimit() then
7478
-- Tell the coroutines to abort to avoid memory leaks

0 commit comments

Comments
 (0)