From 5d4c0f3c87dc4745dcc3bf0082e3715961c5b5d0 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 15 Feb 2023 10:31:52 +0100 Subject: [PATCH 1/2] Bugfix --- Moose Development/Moose/Wrapper/Group.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 19c2b9fd6..99125e66a 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -1,4 +1,4 @@ ---- **Wrapper** - GROUP wraps the DCS Class Group objects. +----- **Wrapper** - GROUP wraps the DCS Class Group objects. -- -- === -- @@ -2810,7 +2810,7 @@ function GROUP:GetCustomCallSign(ShortCallsign,Keepnumber,CallsignTranslations) if self:IsAlive() then local IsPlayer = self:IsPlayer() local shortcallsign = self:GetCallsign() or "unknown91" -- e.g.Uzi91, but we want Uzi 9 1 - local callsignroot = string.match(shortcallsign, '(%a+)') -- Uzi + local callsignroot = string.match(shortcallsign, '(%a+)') or "Ghost" -- Uzi --self:I("CallSign = " .. callsignroot) local groupname = self:GetName() local callnumber = string.match(shortcallsign, "(%d+)$" ) or "91" -- 91 From 35322399e9ae78a844459508f2375009a70095b3 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 15 Feb 2023 12:23:31 +0100 Subject: [PATCH 2/2] #SPOT - minor fixes --- Moose Development/Moose/Core/Spot.lua | 35 ++++++++++++++------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Moose Development/Moose/Core/Spot.lua b/Moose Development/Moose/Core/Spot.lua index f4dc1f967..d87606937 100644 --- a/Moose Development/Moose/Core/Spot.lua +++ b/Moose Development/Moose/Core/Spot.lua @@ -5,7 +5,7 @@ -- SPOT implements the DCS Spot class functionality, but adds additional luxury to be able to: -- -- * Spot 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. -- * Provide a @{Wrapper.Unit} as a target, instead of a point. -- * Implement a status machine, LaseOn, LaseOff. @@ -13,18 +13,8 @@ -- === -- -- # 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) --- --- === --- --- # YouTube Channel --- --- ### [SPOT YouTube Channel]() +-- ### [Demo Missions on GitHub](https://github.com/FlightControl-Master/MOOSE_MISSIONS) -- -- === -- @@ -50,14 +40,14 @@ do --- Implements the target spotting or marking functionality, but adds additional luxury to be able to: -- -- * 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.25 seconds for moving targets. -- * Wiggle the spot at the target. -- * Provide a @{Wrapper.Unit} as a target, instead of a point. -- * Implement a status machine, LaseOn, LaseOff. -- -- ## 1. SPOT constructor -- - -- * @{#SPOT.New}(..\Presentations\SPOT\Dia2.JPG): Creates a new SPOT object. + -- * @{#SPOT.New}(): Creates a new SPOT object. -- -- ## 2. SPOT is a FSM -- @@ -217,6 +207,8 @@ do self.Recce = Recce + + self.RecceName = self.Recce:GetName() self.LaseScheduler = SCHEDULER:New( self ) @@ -243,6 +235,9 @@ do end self.Target = Target + + self.TargetName = Target:GetName() + self.LaserCode = LaserCode self.Lasing = true @@ -302,12 +297,18 @@ do function SPOT:OnEventDead(EventData) self:F( { Dead = EventData.IniDCSUnitName, Target = self.Target } ) if self.Target then - if EventData.IniDCSUnitName == self.Target:GetName() then - self:F( {"Target dead ", self.Target:GetName() } ) + if EventData.IniDCSUnitName == self.TargetName then + self:F( {"Target dead ", self.TargetName } ) self:Destroyed() self:LaseOff() end end + if self.Recce then + if EventData.IniDCSUnitName == self.RecceName then + self:F( {"Recce dead ", self.RecceName } ) + self:LaseOff() + end + end end --- @param #SPOT self @@ -382,4 +383,4 @@ do return self end -end +end \ No newline at end of file