This commit is contained in:
FlightControl_Master
2017-08-08 21:37:12 +02:00
parent 3dde62a550
commit e16e5d9a81
8 changed files with 28 additions and 50 deletions

View File

@@ -417,7 +417,6 @@ function AI_A2A_CAP:onafterEngage( AIGroup, From, Event, To, AttackSetUnit )
self:F( { Angle = ToInterceptAngle, ToTargetSpeed = ToTargetSpeed } )
self:T2( { self.MinSpeed, self.MaxSpeed, ToTargetSpeed } )
EngageRoute[#EngageRoute+1] = ToPatrolRoutePoint
EngageRoute[#EngageRoute+1] = ToPatrolRoutePoint
local AttackTasks = {}
@@ -438,15 +437,10 @@ function AI_A2A_CAP:onafterEngage( AIGroup, From, Event, To, AttackSetUnit )
AIGroup:OptionROTPassiveDefense()
AttackTasks[#AttackTasks+1] = AIGroup:TaskFunction( "AI_A2A_CAP.AttackRoute", self )
EngageRoute[1].task = AIGroup:TaskCombo( AttackTasks )
--- Do a trick, link the NewEngageRoute function of the object to the AIControllable in a temporary variable ...
--AIGroup:SetState( AIGroup, "AI_A2A_CAP", self )
EngageRoute[#EngageRoute].task = AIGroup:TaskCombo( AttackTasks )
end
--- NOW ROUTE THE GROUP!
AIGroup:SetTask( AIGroup:TaskRoute( EngageRoute ), 1 )
AIGroup:Route( EngageRoute, 0.5 )
end
else
self:E("No targets found -> Going back to Patrolling")