mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
AI_AIR
- Fixed call to .Resume function if AI_A2A_CAP is calling.
This commit is contained in:
parent
6208c79d1f
commit
d5b8ed62ae
@ -749,9 +749,19 @@ function AI_AIR:onafterRefuel( AIGroup, From, Event, To )
|
|||||||
AIGroup:OptionROEHoldFire()
|
AIGroup:OptionROEHoldFire()
|
||||||
AIGroup:OptionROTEvadeFire()
|
AIGroup:OptionROTEvadeFire()
|
||||||
|
|
||||||
|
-- Get Class name for .Resume function
|
||||||
|
local classname=self:GetClassName()
|
||||||
|
|
||||||
|
-- AI_A2A_CAP can call this function but does not have a .Resume function. Try to fix.
|
||||||
|
local fsm=self
|
||||||
|
if classname=="AI_A2A_CAP" then
|
||||||
|
fsm=self:GetParent(self, AI_A2A_CAP)
|
||||||
|
classname=fsm:GetClassName()
|
||||||
|
end
|
||||||
|
|
||||||
local Tasks = {}
|
local Tasks = {}
|
||||||
Tasks[#Tasks+1] = AIGroup:TaskRefueling()
|
Tasks[#Tasks+1] = AIGroup:TaskRefueling()
|
||||||
Tasks[#Tasks+1] = AIGroup:TaskFunction( self:GetClassName() .. ".Resume", self )
|
Tasks[#Tasks+1] = AIGroup:TaskFunction( classname .. ".Resume", fsm )
|
||||||
RefuelRoute[#RefuelRoute].task = AIGroup:TaskCombo( Tasks )
|
RefuelRoute[#RefuelRoute].task = AIGroup:TaskCombo( Tasks )
|
||||||
|
|
||||||
AIGroup:Route( RefuelRoute, self.TaskDelay )
|
AIGroup:Route( RefuelRoute, self.TaskDelay )
|
||||||
|
|||||||
@ -356,7 +356,6 @@ function AI_AIR_PATROL:onafterPatrolRoute( AIPatrol, From, Event, To )
|
|||||||
local taskOrbit=AIPatrol:TaskOrbit(c1, altitude, UTILS.KmphToMps(speedkmh), c2)
|
local taskOrbit=AIPatrol:TaskOrbit(c1, altitude, UTILS.KmphToMps(speedkmh), c2)
|
||||||
|
|
||||||
-- Task function to redo the patrol at other random position.
|
-- Task function to redo the patrol at other random position.
|
||||||
--local taskPatrol=AIPatrol:TaskFunction("AI_A2A_PATROL.PatrolRoute", self)
|
|
||||||
local taskPatrol=AIPatrol:TaskFunction("AI_AIR_PATROL.___PatrolRoute", self)
|
local taskPatrol=AIPatrol:TaskFunction("AI_AIR_PATROL.___PatrolRoute", self)
|
||||||
|
|
||||||
-- Controlled task with task condition.
|
-- Controlled task with task condition.
|
||||||
|
|||||||
@ -298,7 +298,8 @@ end
|
|||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
-- @param #BASE Child is the Child class from which the Parent class needs to be retrieved.
|
-- @param #BASE Child This is the Child class from which the Parent class needs to be retrieved.
|
||||||
|
-- @param #BASE FromClass (Optional) The class from which to get the parent.
|
||||||
-- @return #BASE
|
-- @return #BASE
|
||||||
function BASE:GetParent( Child, FromClass )
|
function BASE:GetParent( Child, FromClass )
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user