Merge pull request #240 from FlightControl-Master/master-bugfix

Master bugfix
This commit is contained in:
Sven Van de Velde 2017-02-14 11:09:54 +01:00 committed by GitHub
commit 3776b57164
96 changed files with 103 additions and 64 deletions

View File

@ -617,6 +617,7 @@ do -- FSM
return function( self, DelaySeconds, ... )
self:T2( "Delayed Event: " .. EventName )
local CallID = 0
if DelaySeconds ~= nil then
if DelaySeconds < 0 then -- Only call the event ONCE!
DelaySeconds = math.abs( DelaySeconds )
if not self._EventSchedules[EventName] then
@ -628,6 +629,9 @@ do -- FSM
else
CallID = self.CallScheduler:Schedule( self, self._handler, { EventName, ... }, DelaySeconds or 1 )
end
else
error( "FSM: An asynchronous event trigger requires a DelaySeconds parameter!!! This can be positive or negative! Sorry, but will not process this." )
end
self:T2( { CallID = CallID } )
end
end

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170208_1506' )
env.info( 'Moose Generation Timestamp: 20170214_1049' )
local base = _G
Include = {}
@ -11566,6 +11566,7 @@ do -- FSM
return function( self, DelaySeconds, ... )
self:T2( "Delayed Event: " .. EventName )
local CallID = 0
if DelaySeconds ~= nil then
if DelaySeconds < 0 then -- Only call the event ONCE!
DelaySeconds = math.abs( DelaySeconds )
if not self._EventSchedules[EventName] then
@ -11577,6 +11578,9 @@ do -- FSM
else
CallID = self.CallScheduler:Schedule( self, self._handler, { EventName, ... }, DelaySeconds or 1 )
end
else
error( "FSM: An asynchronous event trigger requires a DelaySeconds parameter!!! This can be positive or negative! Sorry, but will not process this." )
end
self:T2( { CallID = CallID } )
end
end

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170208_1506' )
env.info( 'Moose Generation Timestamp: 20170214_1049' )
local base = _G
Include = {}
@ -11566,6 +11566,7 @@ do -- FSM
return function( self, DelaySeconds, ... )
self:T2( "Delayed Event: " .. EventName )
local CallID = 0
if DelaySeconds ~= nil then
if DelaySeconds < 0 then -- Only call the event ONCE!
DelaySeconds = math.abs( DelaySeconds )
if not self._EventSchedules[EventName] then
@ -11577,6 +11578,9 @@ do -- FSM
else
CallID = self.CallScheduler:Schedule( self, self._handler, { EventName, ... }, DelaySeconds or 1 )
end
else
error( "FSM: An asynchronous event trigger requires a DelaySeconds parameter!!! This can be positive or negative! Sorry, but will not process this." )
end
self:T2( { CallID = CallID } )
end
end

View File

@ -0,0 +1,27 @@
---
-- Name: CAP-020 - Combat Air Patrol RTB Test
-- Author: FlightControl
-- Date Created: 14 February 2017
--
-- # Situation:
-- The Su-27 airplane will patrol in PatrolZone.
-- It will return to base when out of fuel.
--
-- # Test cases:
--
-- 1. Observe the Su-27 patrolling.
-- 2. It should return to base when out of fuel.
--
local CapSpawn = SPAWN:New( "Plane" ):InitLimit(1,2):InitRepeatOnLanding()
local CapGroup = CapSpawn:Spawn()
local PatrolZone = ZONE:New( "Patrol Zone" )
local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
AICapZone:SetControllable( CapGroup )
AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone.

View File

@ -0,0 +1,41 @@
---
-- Name: SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit
-- Author: FlightControl
-- Date Created: 05 Feb 2017
--
-- # Situation:
--
-- One airplane and one helicopter will be spawned.
-- Only one airplane and one helicopter can be alive at the same time.
-- Upon landing, the airplane and helicopter will respawn at Kutaisi.
--
-- # Test cases:
--
-- 1. Observe the spawning of the airplane and helicopter
-- 2. There should not be more airplanes alive than there are set by InitLimit.
-- 3. Upon landing, the planes should respawn.
-- 4. The KA-50 should respawn itself directly when landed.
-- 5. The A-10C should respawn itself when the air unit has parked at the ramp.
do
-- Declare SPAWN objects
local Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 1, 10 )
local Spawn_A_10C = SPAWN:New("A-10C"):InitLimit( 1, 10 )
-- Choose repeat functionality
-- Repeat on landing
Spawn_KA_50:InitRepeatOnLanding()
-- Repeat on enging shutdown (when landed on the airport)
Spawn_A_10C:InitRepeatOnEngineShutDown()
-- Now SPAWN the GROUPs
Spawn_KA_50:SpawnScheduled(30,0)
Spawn_A_10C:SpawnScheduled(30,0)
-- Now run the mission and observe the behaviour.
end

View File

@ -1,41 +0,0 @@
---
-- MOOSE SPAWN repeat test scenario
-- -------------------------------
-- There are 8 GROUPs Spawned.
-- They fly around Kutaisi and will land.
-- Upon landing:
-- 1. The KA-50 and the C-101EB should respawn itself directly when landed.
-- 2. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp.
--
do
-- Declare SPAWN objects
local Spawn_KA_50 = SPAWN:New("KA-50")
local Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2")
local Spawn_C_101EB = SPAWN:New("C-101EB")
local Spawn_A_10C = SPAWN:New("A-10C")
-- Choose repeat functionality
-- Repeat on landing
Spawn_KA_50:InitRepeatOnLanding()
Spawn_C_101EB:InitRepeatOnLanding()
-- Repeat on enging shutdown (when landed on the airport)
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
Spawn_A_10C:InitRepeatOnEngineShutDown()
-- Now SPAWN the GROUPs
Spawn_KA_50:Spawn()
Spawn_C_101EB:Spawn()
Spawn_MI_8MTV2:Spawn()
Spawn_A_10C:Spawn()
Spawn_KA_50:Spawn()
Spawn_C_101EB:Spawn()
Spawn_MI_8MTV2:Spawn()
Spawn_A_10C:Spawn()
-- Now run the mission and observe the behaviour.
end