Implemented an important fix. Refuel airplanes also when they are engaging targets and the fuel treshold has been reached.

This commit is contained in:
FlightControl
2019-08-24 08:56:50 +02:00
parent f951aae3ee
commit 96a904c077
8 changed files with 54 additions and 17 deletions

View File

@@ -461,7 +461,7 @@ function AI_AIR:onafterStatus()
-- end
if not self:Is( "Fuel" ) and not self:Is( "Home" ) then
if not self:Is( "Fuel" ) and not self:Is( "Home" ) and not self:is( "Refuelling" )then
local Fuel = self.Controllable:GetFuelMin()
@@ -680,12 +680,14 @@ end
function AI_AIR:onafterRefuel( AIGroup, From, Event, To )
self:F( { AIGroup, From, Event, To } )
self:E( "Group " .. self.Controllable:GetName() .. " ... Refuelling! ( " .. self:GetState() .. " )" )
if AIGroup and AIGroup:IsAlive() then
local Tanker = GROUP:FindByName( self.TankerName )
if Tanker:IsAlive() and Tanker:IsAirPlane() then
self:E( "Group " .. self.Controllable:GetName() .. " ... Refuelling! ( " .. self:GetState() .. "), at tanker " .. self.TankerName )
local RefuelRoute = {}
--- Calculate the target route point.