mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Bugfix Missile trainer
This commit is contained in:
parent
5f02b5f764
commit
a76ec08499
@ -9,7 +9,7 @@
|
|||||||
-- It suports the following functionality:
|
-- 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.
|
-- * 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 a missile would have killed your aircraft.
|
||||||
-- * Provide alerts when the missile self destructs.
|
-- * Provide alerts when the missile self destructs.
|
||||||
-- * Enable / Disable and Configure the Missile Trainer using the various menu options.
|
-- * 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 )
|
self:T( "Missile Launched = " .. TrainerWeaponName )
|
||||||
|
|
||||||
local TrainerTargetDCSUnit = TrainerWeapon:getTarget() -- Identify target
|
local TrainerTargetDCSUnit = TrainerWeapon:getTarget() -- Identify target
|
||||||
|
if TrainerTargetDCSUnit then
|
||||||
local TrainerTargetDCSUnitName = Unit.getName( TrainerTargetDCSUnit )
|
local TrainerTargetDCSUnitName = Unit.getName( TrainerTargetDCSUnit )
|
||||||
local TrainerTargetSkill = _DATABASE.Templates.Units[TrainerTargetDCSUnitName].Template.skill
|
local TrainerTargetSkill = _DATABASE.Templates.Units[TrainerTargetDCSUnitName].Template.skill
|
||||||
|
|
||||||
@ -498,6 +499,10 @@ function MISSILETRAINER:_EventShot( Event )
|
|||||||
table.insert( self.TrackingMissiles[ClientID].MissileData, MissileData )
|
table.insert( self.TrackingMissiles[ClientID].MissileData, MissileData )
|
||||||
--self:T( self.TrackingMissiles )
|
--self:T( self.TrackingMissiles )
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
-- TODO: some weapons don't know the target unit... Need to develop a workaround for this.
|
||||||
|
TrainerWeapon:destroy()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function MISSILETRAINER:_AddRange( Client, TrainerWeapon )
|
function MISSILETRAINER:_AddRange( Client, TrainerWeapon )
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20160723_1214' )
|
env.info( 'Moose Generation Timestamp: 20160723_1232' )
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
Include = {}
|
Include = {}
|
||||||
@ -23234,7 +23234,7 @@ end
|
|||||||
-- It suports the following functionality:
|
-- 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.
|
-- * 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 a missile would have killed your aircraft.
|
||||||
-- * Provide alerts when the missile self destructs.
|
-- * Provide alerts when the missile self destructs.
|
||||||
-- * Enable / Disable and Configure the Missile Trainer using the various menu options.
|
-- * 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 )
|
self:T( "Missile Launched = " .. TrainerWeaponName )
|
||||||
|
|
||||||
local TrainerTargetDCSUnit = TrainerWeapon:getTarget() -- Identify target
|
local TrainerTargetDCSUnit = TrainerWeapon:getTarget() -- Identify target
|
||||||
|
if TrainerTargetDCSUnit then
|
||||||
local TrainerTargetDCSUnitName = Unit.getName( TrainerTargetDCSUnit )
|
local TrainerTargetDCSUnitName = Unit.getName( TrainerTargetDCSUnit )
|
||||||
local TrainerTargetSkill = _DATABASE.Templates.Units[TrainerTargetDCSUnitName].Template.skill
|
local TrainerTargetSkill = _DATABASE.Templates.Units[TrainerTargetDCSUnitName].Template.skill
|
||||||
|
|
||||||
@ -23723,6 +23724,10 @@ function MISSILETRAINER:_EventShot( Event )
|
|||||||
table.insert( self.TrackingMissiles[ClientID].MissileData, MissileData )
|
table.insert( self.TrackingMissiles[ClientID].MissileData, MissileData )
|
||||||
--self:T( self.TrackingMissiles )
|
--self:T( self.TrackingMissiles )
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
-- TODO: some weapons don't know the target unit... Need to develop a workaround for this.
|
||||||
|
TrainerWeapon:destroy()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function MISSILETRAINER:_AddRange( Client, TrainerWeapon )
|
function MISSILETRAINER:_AddRange( Client, TrainerWeapon )
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20160723_1214' )
|
env.info( 'Moose Generation Timestamp: 20160723_1232' )
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
Include = {}
|
Include = {}
|
||||||
@ -23234,7 +23234,7 @@ end
|
|||||||
-- It suports the following functionality:
|
-- 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.
|
-- * 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 a missile would have killed your aircraft.
|
||||||
-- * Provide alerts when the missile self destructs.
|
-- * Provide alerts when the missile self destructs.
|
||||||
-- * Enable / Disable and Configure the Missile Trainer using the various menu options.
|
-- * 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 )
|
self:T( "Missile Launched = " .. TrainerWeaponName )
|
||||||
|
|
||||||
local TrainerTargetDCSUnit = TrainerWeapon:getTarget() -- Identify target
|
local TrainerTargetDCSUnit = TrainerWeapon:getTarget() -- Identify target
|
||||||
|
if TrainerTargetDCSUnit then
|
||||||
local TrainerTargetDCSUnitName = Unit.getName( TrainerTargetDCSUnit )
|
local TrainerTargetDCSUnitName = Unit.getName( TrainerTargetDCSUnit )
|
||||||
local TrainerTargetSkill = _DATABASE.Templates.Units[TrainerTargetDCSUnitName].Template.skill
|
local TrainerTargetSkill = _DATABASE.Templates.Units[TrainerTargetDCSUnitName].Template.skill
|
||||||
|
|
||||||
@ -23723,6 +23724,10 @@ function MISSILETRAINER:_EventShot( Event )
|
|||||||
table.insert( self.TrackingMissiles[ClientID].MissileData, MissileData )
|
table.insert( self.TrackingMissiles[ClientID].MissileData, MissileData )
|
||||||
--self:T( self.TrackingMissiles )
|
--self:T( self.TrackingMissiles )
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
-- TODO: some weapons don't know the target unit... Need to develop a workaround for this.
|
||||||
|
TrainerWeapon:destroy()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function MISSILETRAINER:_AddRange( Client, TrainerWeapon )
|
function MISSILETRAINER:_AddRange( Client, TrainerWeapon )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user