From a2c241da439b3f33165ef663304a957cbe395ec6 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 5 Jan 2025 17:43:21 +0100 Subject: [PATCH] xx --- Moose Development/Moose/Core/ClientMenu.lua | 12 ++++++---- Moose Development/Moose/Core/Point.lua | 3 +++ Moose Development/Moose/Functional/Mantis.lua | 3 ++- Moose Development/Moose/Ops/CSAR.lua | 23 +++++++++++++++---- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/Moose Development/Moose/Core/ClientMenu.lua b/Moose Development/Moose/Core/ClientMenu.lua index 59ec7169c..ee0b7e6f2 100644 --- a/Moose Development/Moose/Core/ClientMenu.lua +++ b/Moose Development/Moose/Core/ClientMenu.lua @@ -20,7 +20,7 @@ -- -- @module Core.ClientMenu -- @image Core_Menu.JPG --- last change: May 2024 +-- last change: Jan 2025 -- TODO ---------------------------------------------------------------------------------------------------------------- @@ -59,7 +59,7 @@ CLIENTMENU = { ClassName = "CLIENTMENUE", lid = "", - version = "0.1.2", + version = "0.1.3", name = nil, path = nil, group = nil, @@ -455,7 +455,7 @@ end -- @param #CLIENTMENUMANAGER self -- @param Core.Event#EVENTDATA EventData -- @return #CLIENTMENUMANAGER self -function CLIENTMENUMANAGER:_EventHandler(EventData) +function CLIENTMENUMANAGER:_EventHandler(EventData,Retry) self:T(self.lid.."_EventHandler: "..EventData.id) --self:I(self.lid.."_EventHandler: "..tostring(EventData.IniPlayerName)) if EventData.id == EVENTS.PlayerLeaveUnit or EventData.id == EVENTS.Ejection or EventData.id == EVENTS.Crash or EventData.id == EVENTS.PilotDead then @@ -468,6 +468,10 @@ function CLIENTMENUMANAGER:_EventHandler(EventData) if EventData.IniPlayerName and EventData.IniGroup then if (not self.clientset:IsIncludeObject(_DATABASE:FindClient( EventData.IniUnitName ))) then self:T(self.lid.."Client not in SET: "..EventData.IniPlayerName) + if not Retry then + -- try again in 2 secs + self:ScheduleOnce(2,CLIENTMENUMANAGER._EventHandler,self,EventData,true) + end return self end --self:I(self.lid.."Join event for player: "..EventData.IniPlayerName) @@ -524,7 +528,7 @@ function CLIENTMENUMANAGER:InitAutoPropagation() self:HandleEvent(EVENTS.PilotDead, self._EventHandler) self:HandleEvent(EVENTS.PlayerEnterAircraft, self._EventHandler) self:HandleEvent(EVENTS.PlayerEnterUnit, self._EventHandler) - self:SetEventPriority(5) + self:SetEventPriority(6) return self end diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index 964f8e1ee..7f2b3d558 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -970,6 +970,9 @@ do -- COORDINATE if not TargetCoordinate then return 1000000 end --local a={x=TargetCoordinate.x-self.x, y=0, z=TargetCoordinate.z-self.z} local a = self:GetVec2() + if not TargetCoordinate.ClassName then + TargetCoordinate=COORDINATE:NewFromVec3(TargetCoordinate) + end local b = TargetCoordinate:GetVec2() local norm=UTILS.VecDist2D(a,b) return norm diff --git a/Moose Development/Moose/Functional/Mantis.lua b/Moose Development/Moose/Functional/Mantis.lua index f066d9fd3..28f511a91 100644 --- a/Moose Development/Moose/Functional/Mantis.lua +++ b/Moose Development/Moose/Functional/Mantis.lua @@ -1733,11 +1733,12 @@ do self.SamStateTracker[name] = "RED" end if shortsam == true and self.SmokeDecoy == true then + self:I("Smoking") local units = samgroup:GetUnits() or {} local smoke = self.SmokeDecoyColor or SMOKECOLOR.White for _,unit in pairs(units) do if unit and unit:IsAlive() then - unit:Smoke(smoke,2,2) + unit:GetCoordinate():Smoke(smoke) end end end diff --git a/Moose Development/Moose/Ops/CSAR.lua b/Moose Development/Moose/Ops/CSAR.lua index 4bf18ac40..8cc55125c 100644 --- a/Moose Development/Moose/Ops/CSAR.lua +++ b/Moose Development/Moose/Ops/CSAR.lua @@ -31,7 +31,7 @@ -- @image OPS_CSAR.jpg --- --- Last Update Sep 2024 +-- Last Update Jan 2025 ------------------------------------------------------------------------- --- **CSAR** class, extends Core.Base#BASE, Core.Fsm#FSM @@ -92,7 +92,7 @@ -- mycsar.immortalcrew = true -- Set to true to make wounded crew immortal. -- mycsar.invisiblecrew = false -- Set to true to make wounded crew insvisible. -- mycsar.loadDistance = 75 -- configure distance for pilots to get into helicopter in meters. --- mycsar.mashprefix = {"MASH"} -- prefixes of #GROUP objects used as MASHes. +-- mycsar.mashprefix = {"MASH"} -- prefixes of #GROUP objects used as MASHes. Will also try to add ZONE and STATIC objects with this prefix once at startup. -- mycsar.max_units = 6 -- max number of pilots that can be carried if #CSAR.AircraftType is undefined. -- mycsar.messageTime = 15 -- Time to show messages for in seconds. Doubled for long messages. -- mycsar.radioSound = "beacon.ogg" -- the name of the sound file to use for the pilots\' radio beacons. @@ -313,7 +313,7 @@ CSAR.AircraftType["CH-47Fbl1"] = 31 --- CSAR class version. -- @field #string version -CSAR.version="1.0.29" +CSAR.version="1.0.30" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- ToDo list @@ -2425,7 +2425,22 @@ function CSAR:onafterStart(From, Event, To) self.allheligroupset = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterCategoryHelicopter():FilterStart() end - self.mash = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterStart() -- currently only GROUP objects, maybe support STATICs also? + self.mash = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterStart() + + local staticmashes = SET_STATIC:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterOnce() + local zonemashes = SET_ZONE:New():FilterPrefixes(self.mashprefix):FilterOnce() + + if staticmashes:Count() > 0 then + for _,_mash in pairs(staticmashes.Set) do + self.mash:AddObject(_mash) + end + end + + if zonemashes:Count() > 0 then + for _,_mash in pairs(zonemashes.Set) do + self.mash:AddObject(_mash) + end + end if not self.coordinate then local csarhq = self.mash:GetRandom()