mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#SPAWN - Added StopRepeat()
This commit is contained in:
parent
d86f471361
commit
084c172e93
@ -199,6 +199,7 @@
|
||||
--
|
||||
-- * @{#SPAWN.InitRepeat}() or @{#SPAWN.InitRepeatOnLanding}(): This method is used to re-spawn automatically the same group after it has landed.
|
||||
-- * @{#SPAWN.InitRepeatOnEngineShutDown}(): This method is used to re-spawn automatically the same group after it has landed and it shuts down the engines at the ramp.
|
||||
-- * @{#SPAWN.StopRepeat}(): This method is used to stop the repeater.
|
||||
--
|
||||
-- ### Link-16 Datalink STN and SADL IDs (limited at the moment to F15/16/18/AWACS/Tanker/B1B, but not the F15E for clients, SADL A10CII only)
|
||||
--
|
||||
@ -1411,6 +1412,30 @@ function SPAWN:InitArray( SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Stop the SPAWN InitRepeat function (EVENT handler for takeoff, land and engine shutdown)
|
||||
-- @param #SPAWN self
|
||||
-- @return #SPAWN self
|
||||
-- @usage
|
||||
-- local spawn = SPAWN:New("Template Group")
|
||||
-- :InitRepeatOnEngineShutDown()
|
||||
-- local plane = spawn:Spawn() -- it is important that we keep the SPAWN object and do not overwrite it with the resulting GROUP object by just calling :Spawn()
|
||||
--
|
||||
-- -- later on
|
||||
-- spawn:StopRepeat()
|
||||
function SPAWN:StopRepeat()
|
||||
if self.Repeat then
|
||||
self:UnHandleEvent(EVENTS.Takeoff)
|
||||
self:UnHandleEvent(EVENTS.Land)
|
||||
end
|
||||
if self.RepeatOnEngineShutDown then
|
||||
self:UnHandleEvent(EVENTS.EngineShutdown)
|
||||
end
|
||||
self.Repeat = false
|
||||
self.RepeatOnEngineShutDown = false
|
||||
self.RepeatOnLanding = false
|
||||
return self
|
||||
end
|
||||
|
||||
do -- AI methods
|
||||
|
||||
--- Turns the AI On or Off for the @{Wrapper.Group} when spawning.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user