Bugfix Missile trainer

This commit is contained in:
FlightControl 2016-07-23 12:32:50 +02:00
parent 5f02b5f764
commit a76ec08499
3 changed files with 122 additions and 107 deletions

View File

@ -9,7 +9,7 @@
-- It suports the following functionality:
--
-- * Track the missiles fired at you and other players, providing bearing and range information of the missiles towards the airplanes.
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range <EFBFBD>
-- * Provide alerts when a missile would have killed your aircraft.
-- * Provide alerts when the missile self destructs.
-- * Enable / Disable and Configure the Missile Trainer using the various menu options.
@ -461,6 +461,7 @@ function MISSILETRAINER:_EventShot( Event )
self:T( "Missile Launched = " .. TrainerWeaponName )
local TrainerTargetDCSUnit = TrainerWeapon:getTarget() -- Identify target
if TrainerTargetDCSUnit then
local TrainerTargetDCSUnitName = Unit.getName( TrainerTargetDCSUnit )
local TrainerTargetSkill = _DATABASE.Templates.Units[TrainerTargetDCSUnitName].Template.skill
@ -498,6 +499,10 @@ function MISSILETRAINER:_EventShot( Event )
table.insert( self.TrackingMissiles[ClientID].MissileData, MissileData )
--self:T( self.TrackingMissiles )
end
else
-- TODO: some weapons don't know the target unit... Need to develop a workaround for this.
TrainerWeapon:destroy()
end
end
function MISSILETRAINER:_AddRange( Client, TrainerWeapon )

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20160723_1214' )
env.info( 'Moose Generation Timestamp: 20160723_1232' )
local base = _G
Include = {}
@ -23234,7 +23234,7 @@ end
-- It suports the following functionality:
--
-- * Track the missiles fired at you and other players, providing bearing and range information of the missiles towards the airplanes.
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range <EFBFBD>
-- * Provide alerts when a missile would have killed your aircraft.
-- * Provide alerts when the missile self destructs.
-- * Enable / Disable and Configure the Missile Trainer using the various menu options.
@ -23686,6 +23686,7 @@ function MISSILETRAINER:_EventShot( Event )
self:T( "Missile Launched = " .. TrainerWeaponName )
local TrainerTargetDCSUnit = TrainerWeapon:getTarget() -- Identify target
if TrainerTargetDCSUnit then
local TrainerTargetDCSUnitName = Unit.getName( TrainerTargetDCSUnit )
local TrainerTargetSkill = _DATABASE.Templates.Units[TrainerTargetDCSUnitName].Template.skill
@ -23723,6 +23724,10 @@ function MISSILETRAINER:_EventShot( Event )
table.insert( self.TrackingMissiles[ClientID].MissileData, MissileData )
--self:T( self.TrackingMissiles )
end
else
-- TODO: some weapons don't know the target unit... Need to develop a workaround for this.
TrainerWeapon:destroy()
end
end
function MISSILETRAINER:_AddRange( Client, TrainerWeapon )

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20160723_1214' )
env.info( 'Moose Generation Timestamp: 20160723_1232' )
local base = _G
Include = {}
@ -23234,7 +23234,7 @@ end
-- It suports the following functionality:
--
-- * Track the missiles fired at you and other players, providing bearing and range information of the missiles towards the airplanes.
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range <EFBFBD>
-- * Provide alerts when a missile would have killed your aircraft.
-- * Provide alerts when the missile self destructs.
-- * Enable / Disable and Configure the Missile Trainer using the various menu options.
@ -23686,6 +23686,7 @@ function MISSILETRAINER:_EventShot( Event )
self:T( "Missile Launched = " .. TrainerWeaponName )
local TrainerTargetDCSUnit = TrainerWeapon:getTarget() -- Identify target
if TrainerTargetDCSUnit then
local TrainerTargetDCSUnitName = Unit.getName( TrainerTargetDCSUnit )
local TrainerTargetSkill = _DATABASE.Templates.Units[TrainerTargetDCSUnitName].Template.skill
@ -23723,6 +23724,10 @@ function MISSILETRAINER:_EventShot( Event )
table.insert( self.TrackingMissiles[ClientID].MissileData, MissileData )
--self:T( self.TrackingMissiles )
end
else
-- TODO: some weapons don't know the target unit... Need to develop a workaround for this.
TrainerWeapon:destroy()
end
end
function MISSILETRAINER:_AddRange( Client, TrainerWeapon )