Skip to content

Commit

Permalink
Finish 2.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
FlightControl-User committed Nov 6, 2018
2 parents b0885ad + a36e392 commit f4a89d6
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 58 deletions.
23 changes: 15 additions & 8 deletions Moose Development/Moose/AI/AI_A2A.lua
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,14 @@ function AI_A2A:onafterStatus()
RTB = false
end
end

if self:Is( "Fuel" ) or self:Is( "Damaged" ) or self:Is( "LostControl" ) then
if DistanceFromHomeBase < 5000 then
self:E( self.Controllable:GetName() .. " is too far from home base, RTB!" )
self:Home( "Destroy" )
end
end

-- I think this code is not requirement anymore after release 2.5.
-- if self:Is( "Fuel" ) or self:Is( "Damaged" ) or self:Is( "LostControl" ) then
-- if DistanceFromHomeBase < 5000 then
-- self:E( self.Controllable:GetName() .. " is near the home base, RTB!" )
-- self:Home( "Destroy" )
-- end
-- end


if not self:Is( "Fuel" ) and not self:Is( "Home" ) then
Expand Down Expand Up @@ -481,9 +482,12 @@ function AI_A2A:onafterStatus()
end

-- Check if planes went RTB and are out of control.
-- We only check if planes are out of control, when they are in duty.
if self.Controllable:HasTask() == false then
if not self:Is( "Started" ) and
not self:Is( "Stopped" ) and
not self:Is( "Fuel" ) and
not self:Is( "Damaged" ) and
not self:Is( "Home" ) then
if self.IdleCount >= 2 then
if Damage ~= InitialLife then
Expand All @@ -503,8 +507,11 @@ function AI_A2A:onafterStatus()
if RTB == true then
self:__RTB( 0.5 )
end

if not self:Is("Home") then
self:__Status( 10 )
end

self:__Status( 10 )
end
end

Expand Down
Loading

0 comments on commit f4a89d6

Please sign in to comment.