Merge pull request #248 from FlightControl-Master/master-bugfix-group-isalive

Master bugfix group isalive
This commit is contained in:
Sven Van de Velde 2017-02-23 17:29:09 +01:00 committed by GitHub
commit 35a2bb459c
6 changed files with 51 additions and 5 deletions

View File

@ -184,7 +184,7 @@ function GROUP:IsAlive()
local DCSGroup = self:GetDCSObject()
if DCSGroup then
local GroupIsAlive = DCSGroup:isExist()
local GroupIsAlive = DCSGroup:isExist() and DCSGroup:getUnit(1) ~= nil
self:T3( GroupIsAlive )
return GroupIsAlive
end

View File

@ -0,0 +1,14 @@
---
-- Name: XXX-999 - Title
-- Author: YYY
-- Date Created: DD Mmm YYYY
--
-- # Situation:
--
--
--
-- # Test cases:
--
-- 1.

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170221_1153' )
env.info( 'Moose Generation Timestamp: 20170223_1723' )
local base = _G
Include = {}
@ -15359,7 +15359,7 @@ function GROUP:IsAlive()
local DCSGroup = self:GetDCSObject()
if DCSGroup then
local GroupIsAlive = DCSGroup:isExist()
local GroupIsAlive = DCSGroup:isExist() and DCSGroup:getUnit(1) ~= nil
self:T3( GroupIsAlive )
return GroupIsAlive
end

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170221_1153' )
env.info( 'Moose Generation Timestamp: 20170223_1723' )
local base = _G
Include = {}
@ -15359,7 +15359,7 @@ function GROUP:IsAlive()
local DCSGroup = self:GetDCSObject()
if DCSGroup then
local GroupIsAlive = DCSGroup:isExist()
local GroupIsAlive = DCSGroup:isExist() and DCSGroup:getUnit(1) ~= nil
self:T3( GroupIsAlive )
return GroupIsAlive
end

View File

@ -0,0 +1,32 @@
---
-- Name: GRP-100 - IsAlive
-- Author: FlightControl
-- Date Created: 23 Feb 2017
--
-- # Situation:
--
-- This test is about checking if IsAlive on GROUP level is working correctly.
-- Two ground forces GROUPS are shooting each other.
-- Check the IsAlive status in the logging of the survivor and the defeat.
--
-- # Test cases:
--
-- 1. Observe the IsAlive statuses in the dcs.log file.
--Create Spawn Groups
local GroupBlue = GROUP:FindByName( "Blue" )
local GroupRed = GROUP:FindByName( "Red" )
local Schedule, ScheduleID = SCHEDULER:New( nil,
--- Variable Declarations
-- @param Wrapper.Group#GROUP GroupBlue
-- @param Wrapper.Group#GROUP GroupRed
function( GroupBlue, GroupRed )
local IsAliveBlue = GroupBlue:IsAlive()
local IsAliveRed = GroupRed:IsAlive()
BASE:E( { IsAliveBlue = IsAliveBlue, IsAliveRed = IsAliveRed } )
end, { GroupBlue, GroupRed }, 1, 1
)