mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-31 07:44:30 +00:00
Fixed bug during detection, when i unit got destroyed, the detection stopped. Fixed now
Added a test :IsAlive
This commit is contained in:
@@ -111,6 +111,7 @@ function DETECTION_BASE:_DetectionScheduler( SchedulerName )
|
||||
if self.DetectedUnits then
|
||||
for DetectedUnitName, DetectedUnitData in pairs( self.DetectedUnits ) do
|
||||
local DetectedUnit = DetectedUnitData.DetectedUnit -- Unit#UNIT
|
||||
if DetectedUnit and DetectedUnit:IsAlive() then
|
||||
self:T( DetectedUnit:GetName() )
|
||||
if #self.DetectedUnitSets == 0 then
|
||||
self:T( { "Adding Unit Set #", 1 } )
|
||||
@@ -140,6 +141,7 @@ function DETECTION_BASE:_DetectionScheduler( SchedulerName )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Now all the tests should have been build, now make some smoke and flares...
|
||||
|
||||
|
||||
@@ -390,7 +390,7 @@ end
|
||||
-- @param #SET_BASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
function SET_BASE:_EventOnDeadOrCrash( Event )
|
||||
self:F3( { Event } )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniDCSUnit then
|
||||
local ObjectName, Object = self:FindInDatabase( Event )
|
||||
@@ -957,6 +957,10 @@ function SET_UNIT:New()
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, SET_BASE:New( _DATABASE.UNITS ) )
|
||||
|
||||
_EVENTDISPATCHER:OnBirth( self._EventOnBirth, self )
|
||||
_EVENTDISPATCHER:OnDead( self._EventOnDeadOrCrash, self )
|
||||
_EVENTDISPATCHER:OnCrash( self._EventOnDeadOrCrash, self )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -965,6 +969,7 @@ end
|
||||
-- @param #string AddUnit A single UNIT.
|
||||
-- @return #SET_UNIT self
|
||||
function SET_UNIT:AddUnit( AddUnit )
|
||||
self:F2( AddUnit:GetName() )
|
||||
|
||||
self:Add( AddUnit:GetName(), AddUnit )
|
||||
|
||||
@@ -1151,6 +1156,7 @@ end
|
||||
function SET_UNIT:FindInDatabase( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
self:E( { Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName] } )
|
||||
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
|
||||
end
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+990
-138
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Reference in New Issue
Block a user