mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Done fixed for SLMOD. Need to retest.
This commit is contained in:
@@ -440,7 +440,7 @@ end
|
||||
-- @param Arguments A #table or any field.
|
||||
function BASE:_F( Arguments, DebugInfoCurrentParam, DebugInfoFromParam )
|
||||
|
||||
if ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then
|
||||
if debug and ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then
|
||||
|
||||
local DebugInfoCurrent = DebugInfoCurrentParam and DebugInfoCurrentParam or debug.getinfo( 2, "nl" )
|
||||
local DebugInfoFrom = DebugInfoFromParam and DebugInfoFromParam or debug.getinfo( 3, "l" )
|
||||
@@ -469,7 +469,7 @@ end
|
||||
-- @param Arguments A #table or any field.
|
||||
function BASE:F( Arguments )
|
||||
|
||||
if _TraceOnOff then
|
||||
if debug and _TraceOnOff then
|
||||
local DebugInfoCurrent = debug.getinfo( 2, "nl" )
|
||||
local DebugInfoFrom = debug.getinfo( 3, "l" )
|
||||
|
||||
@@ -485,7 +485,7 @@ end
|
||||
-- @param Arguments A #table or any field.
|
||||
function BASE:F2( Arguments )
|
||||
|
||||
if _TraceOnOff then
|
||||
if debug and _TraceOnOff then
|
||||
local DebugInfoCurrent = debug.getinfo( 2, "nl" )
|
||||
local DebugInfoFrom = debug.getinfo( 3, "l" )
|
||||
|
||||
@@ -500,7 +500,7 @@ end
|
||||
-- @param Arguments A #table or any field.
|
||||
function BASE:F3( Arguments )
|
||||
|
||||
if _TraceOnOff then
|
||||
if debug and _TraceOnOff then
|
||||
local DebugInfoCurrent = debug.getinfo( 2, "nl" )
|
||||
local DebugInfoFrom = debug.getinfo( 3, "l" )
|
||||
|
||||
@@ -515,7 +515,7 @@ end
|
||||
-- @param Arguments A #table or any field.
|
||||
function BASE:_T( Arguments, DebugInfoCurrentParam, DebugInfoFromParam )
|
||||
|
||||
if ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then
|
||||
if debug and ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then
|
||||
|
||||
local DebugInfoCurrent = DebugInfoCurrentParam and DebugInfoCurrentParam or debug.getinfo( 2, "nl" )
|
||||
local DebugInfoFrom = DebugInfoFromParam and DebugInfoFromParam or debug.getinfo( 3, "l" )
|
||||
@@ -544,7 +544,7 @@ end
|
||||
-- @param Arguments A #table or any field.
|
||||
function BASE:T( Arguments )
|
||||
|
||||
if _TraceOnOff then
|
||||
if debug and _TraceOnOff then
|
||||
local DebugInfoCurrent = debug.getinfo( 2, "nl" )
|
||||
local DebugInfoFrom = debug.getinfo( 3, "l" )
|
||||
|
||||
@@ -560,7 +560,7 @@ end
|
||||
-- @param Arguments A #table or any field.
|
||||
function BASE:T2( Arguments )
|
||||
|
||||
if _TraceOnOff then
|
||||
if debug and _TraceOnOff then
|
||||
local DebugInfoCurrent = debug.getinfo( 2, "nl" )
|
||||
local DebugInfoFrom = debug.getinfo( 3, "l" )
|
||||
|
||||
@@ -575,7 +575,7 @@ end
|
||||
-- @param Arguments A #table or any field.
|
||||
function BASE:T3( Arguments )
|
||||
|
||||
if _TraceOnOff then
|
||||
if debug and _TraceOnOff then
|
||||
local DebugInfoCurrent = debug.getinfo( 2, "nl" )
|
||||
local DebugInfoFrom = debug.getinfo( 3, "l" )
|
||||
|
||||
@@ -590,21 +590,24 @@ end
|
||||
-- @param Arguments A #table or any field.
|
||||
function BASE:E( Arguments )
|
||||
|
||||
local DebugInfoCurrent = debug.getinfo( 2, "nl" )
|
||||
local DebugInfoFrom = debug.getinfo( 3, "l" )
|
||||
|
||||
local Function = "function"
|
||||
if DebugInfoCurrent.name then
|
||||
Function = DebugInfoCurrent.name
|
||||
end
|
||||
|
||||
local LineCurrent = DebugInfoCurrent.currentline
|
||||
local LineFrom = -1
|
||||
if DebugInfoFrom then
|
||||
LineFrom = DebugInfoFrom.currentline
|
||||
end
|
||||
|
||||
env.info( string.format( "%6d(%6d)/%1s:%20s%05d.%s(%s)" , LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, routines.utils.oneLineSerialize( Arguments ) ) )
|
||||
if debug then
|
||||
local DebugInfoCurrent = debug.getinfo( 2, "nl" )
|
||||
local DebugInfoFrom = debug.getinfo( 3, "l" )
|
||||
|
||||
local Function = "function"
|
||||
if DebugInfoCurrent.name then
|
||||
Function = DebugInfoCurrent.name
|
||||
end
|
||||
|
||||
local LineCurrent = DebugInfoCurrent.currentline
|
||||
local LineFrom = -1
|
||||
if DebugInfoFrom then
|
||||
LineFrom = DebugInfoFrom.currentline
|
||||
end
|
||||
|
||||
env.info( string.format( "%6d(%6d)/%1s:%20s%05d.%s(%s)" , LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, routines.utils.oneLineSerialize( Arguments ) ) )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -394,15 +394,17 @@ function DETECTION_UNITGROUPS:SmokeDetectedUnits()
|
||||
self:F2()
|
||||
|
||||
self._SmokeDetectedUnits = true
|
||||
return self
|
||||
end
|
||||
|
||||
--- Flare the detected units
|
||||
-- @param #DETECTION_UNITGROUPS self
|
||||
-- @return #DETECTION_UNITGROUPS self
|
||||
function DETECTION_UNITGROUPS:SmokeDetectedUnits()
|
||||
function DETECTION_UNITGROUPS:FlareDetectedUnits()
|
||||
self:F2()
|
||||
|
||||
self._FlareDetectedUnits = true
|
||||
return self
|
||||
end
|
||||
|
||||
--- Smoke the detected zones
|
||||
@@ -412,6 +414,7 @@ function DETECTION_UNITGROUPS:SmokeDetectedZones()
|
||||
self:F2()
|
||||
|
||||
self._SmokeDetectedZones = true
|
||||
return self
|
||||
end
|
||||
|
||||
--- Flare the detected zones
|
||||
@@ -421,6 +424,7 @@ function DETECTION_UNITGROUPS:FlareDetectedZones()
|
||||
self:F2()
|
||||
|
||||
self._FlareDetectedZones = true
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
@@ -445,7 +449,6 @@ function DETECTION_UNITGROUPS:CreateDetectionSets()
|
||||
for DetectedZoneIndex = 1, #self.DetectedZones do
|
||||
self:T( "Detected Unit Set #" .. DetectedZoneIndex )
|
||||
local DetectedUnitSet = self.DetectedSets[DetectedZoneIndex] -- Set#SET_BASE
|
||||
DetectedUnitSet:Flush()
|
||||
local DetectedZone = self.DetectedZones[DetectedZoneIndex] -- Zone#ZONE_UNIT
|
||||
if DetectedUnit:IsInZone( DetectedZone ) then
|
||||
self:T( "Adding to Unit Set #" .. DetectedZoneIndex )
|
||||
|
||||
@@ -465,7 +465,8 @@ function EVENT:OnPlayerLeaveUnit( EventFunction, EventSelf )
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- @param #EVENT self
|
||||
-- @param #EVENTDATA Event
|
||||
function EVENT:onEvent( Event )
|
||||
self:F2( { _EVENTCODES[Event.id], Event } )
|
||||
|
||||
@@ -499,7 +500,7 @@ function EVENT:onEvent( Event )
|
||||
Event.WeaponName = Event.Weapon:getTypeName()
|
||||
--Event.WeaponTgtDCSUnit = Event.Weapon:getTarget()
|
||||
end
|
||||
self:E( { _EVENTCODES[Event.id], Event } )
|
||||
self:E( { _EVENTCODES[Event.id], Event.IniUnitName, Event.TgtUnitName, Event.WeaponName } )
|
||||
for ClassName, EventData in pairs( self.Events[Event.id] ) do
|
||||
if Event.IniDCSUnitName and EventData.IniUnit and EventData.IniUnit[Event.IniDCSUnitName] then
|
||||
self:E( { "Calling event function for class ", ClassName, " unit ", Event.IniDCSUnitName } )
|
||||
|
||||
@@ -111,8 +111,10 @@ function SCHEDULER:_Scheduler()
|
||||
local ErrorHandler = function( errmsg )
|
||||
|
||||
env.info( "Error in SCHEDULER function:" .. errmsg )
|
||||
env.info( debug.traceback() )
|
||||
|
||||
if debug ~= nil then
|
||||
env.info( debug.traceback() )
|
||||
end
|
||||
|
||||
return errmsg
|
||||
end
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ function SEAD:EventShot( Event )
|
||||
local SEADUnitName = Event.IniDCSUnitName
|
||||
local SEADWeapon = Event.Weapon -- Identify the weapon fired
|
||||
local SEADWeaponName = Event.WeaponName -- return weapon type
|
||||
--trigger.action.outText( string.format("Alerte, depart missile " ..string.format(SEADWeaponName)), 20) --debug message
|
||||
-- Start of the 2nd loop
|
||||
self:T( "Missile Launched = " .. SEADWeaponName )
|
||||
if SEADWeaponName == "KH-58" or SEADWeaponName == "KH-25MPU" or SEADWeaponName == "AGM-88" or SEADWeaponName == "KH-31A" or SEADWeaponName == "KH-31P" then -- Check if the missile is a SEAD
|
||||
@@ -76,10 +75,10 @@ function SEAD:EventShot( Event )
|
||||
local Skills = { "Average", "Good", "High", "Excellent" }
|
||||
_targetskill = Skills[ math.random(1,4) ]
|
||||
end
|
||||
self:T( _targetskill ) -- debug message for skill check
|
||||
self:T( _targetskill )
|
||||
if self.TargetSkill[_targetskill] then
|
||||
if (_evade > self.TargetSkill[_targetskill].Evade) then
|
||||
self:T( string.format("Evading, target skill " ..string.format(_targetskill)) ) --debug message
|
||||
self:T( string.format("Evading, target skill " ..string.format(_targetskill)) )
|
||||
local _targetMim = Weapon.getTarget(SEADWeapon)
|
||||
local _targetMimname = Unit.getName(_targetMim)
|
||||
local _targetMimgroup = Unit.getGroup(Weapon.getTarget(SEADWeapon))
|
||||
|
||||
@@ -399,7 +399,7 @@ end
|
||||
-- @param #SET_BASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
function SET_BASE:_EventOnDeadOrCrash( Event )
|
||||
self:F2( { Event } )
|
||||
self:F3( { Event } )
|
||||
|
||||
if Event.IniDCSUnit then
|
||||
local ObjectName, Object = self:FindInDatabase( Event )
|
||||
@@ -455,7 +455,7 @@ function SET_BASE:ForEach( IteratorFunction, arg, Set, Function, FunctionArgumen
|
||||
local function CoRoutine()
|
||||
local Count = 0
|
||||
for ObjectID, Object in pairs( Set ) do
|
||||
self:T2( Object )
|
||||
self:T3( Object )
|
||||
if Function then
|
||||
if Function( unpack( FunctionArguments ), Object ) == true then
|
||||
IteratorFunction( Object, unpack( arg ) )
|
||||
@@ -544,7 +544,7 @@ function SET_BASE:IsIncludeObject( Object )
|
||||
return true
|
||||
end
|
||||
|
||||
--- Flushes the current SET_BASE contents in the log ... (for debug reasons).
|
||||
--- Flushes the current SET_BASE contents in the log ... (for debugging reasons).
|
||||
-- @param #SET_BASE self
|
||||
-- @return #string A string with the names of the objects.
|
||||
function SET_BASE:Flush()
|
||||
@@ -1165,7 +1165,6 @@ 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user