#SPOT - minor fixes

This commit is contained in:
Applevangelist 2023-02-15 12:17:49 +01:00
parent 250b12c041
commit 65d3c3f277

View File

@ -13,18 +13,8 @@
-- === -- ===
-- --
-- # Demo Missions -- # Demo Missions
--
-- ### [SPOT Demo Missions source code]()
--
-- ### [SPOT Demo Missions, only for beta testers]()
-- --
-- ### [ALL Demo Missions pack of the last release](https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases) -- ### [Demo Missions on GitHub](https://github.com/FlightControl-Master/MOOSE_MISSIONS)
--
-- ===
--
-- # YouTube Channel
--
-- ### [SPOT YouTube Channel]()
-- --
-- === -- ===
-- --
@ -50,7 +40,7 @@ do
--- Implements the target spotting or marking functionality, but adds additional luxury to be able to: --- Implements the target spotting or marking functionality, but adds additional luxury to be able to:
-- --
-- * Mark targets for a defined duration. -- * Mark targets for a defined duration.
-- * Updates of laer spot position every 0.2 seconds for moving targets. -- * Updates of laser spot position every 0.2 seconds for moving targets.
-- * Wiggle the spot at the target. -- * Wiggle the spot at the target.
-- * Provide a @{Wrapper.Unit} as a target, instead of a point. -- * Provide a @{Wrapper.Unit} as a target, instead of a point.
-- * Implement a status machine, LaseOn, LaseOff. -- * Implement a status machine, LaseOn, LaseOff.
@ -217,6 +207,8 @@ do
self.Recce = Recce self.Recce = Recce
self.RecceName = self.Recce:GetName()
self.LaseScheduler = SCHEDULER:New( self ) self.LaseScheduler = SCHEDULER:New( self )
@ -243,6 +235,9 @@ do
end end
self.Target = Target self.Target = Target
self.TargetName = Target:GetName()
self.LaserCode = LaserCode self.LaserCode = LaserCode
self.Lasing = true self.Lasing = true
@ -302,12 +297,18 @@ do
function SPOT:OnEventDead(EventData) function SPOT:OnEventDead(EventData)
self:F( { Dead = EventData.IniDCSUnitName, Target = self.Target } ) self:F( { Dead = EventData.IniDCSUnitName, Target = self.Target } )
if self.Target then if self.Target then
if EventData.IniDCSUnitName == self.Target:GetName() then if EventData.IniDCSUnitName == self.TargetName then
self:F( {"Target dead ", self.Target:GetName() } ) self:F( {"Target dead ", self.TargetName } )
self:Destroyed() self:Destroyed()
self:LaseOff() self:LaseOff()
end end
end end
if self.Recce then
if EventData.IniDCSUnitName == self.RecceName then
self:F( {"Recce dead ", self.RecceName } )
self:LaseOff()
end
end
end end
--- @param #SPOT self --- @param #SPOT self