From fbcc4ee32b6750371184f6f53c23c0d971cf5276 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Sat, 11 Jan 2025 10:14:03 +0100 Subject: [PATCH 1/2] Update Unit.lua GetSTN fix if template os nil --- Moose Development/Moose/Wrapper/Unit.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua index 9230eaeee..6bfd2eb45 100644 --- a/Moose Development/Moose/Wrapper/Unit.lua +++ b/Moose Development/Moose/Wrapper/Unit.lua @@ -1777,7 +1777,8 @@ function UNIT:GetSTN() local VCN = nil -- VoiceCallsignNumber local FGL = false -- FlightGroupLeader local template = self:GetTemplate() - if template.AddPropAircraft then + if template then + if template.AddPropAircraft then if template.AddPropAircraft.STN_L16 then STN = template.AddPropAircraft.STN_L16 elseif template.AddPropAircraft.SADL_TN then @@ -1793,6 +1794,6 @@ function UNIT:GetSTN() if template.datalinks and template.datalinks.SADL and template.datalinks.SADL.settings then FGL = template.datalinks.SADL.settings.flightLead end - + end return STN, VCL, VCN, FGL end From def622a02c01dc15e5f8f68a3458f4f6de27cc83 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 12 Jan 2025 17:03:18 +0100 Subject: [PATCH 2/2] #CTLD - InjectTroops - if precision coords is true, do also not randomize unit positions. --- Moose Development/Moose/Ops/CTLD.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index 73d870cc3..26295b17a 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -1352,7 +1352,7 @@ CTLD.UnitTypeCapabilities = { --- CTLD class version. -- @field #string version -CTLD.version="1.1.22" +CTLD.version="1.1.23" --- Instantiate a new CTLD. -- @param #CTLD self @@ -5583,11 +5583,12 @@ end if PreciseLocation then randomcoord = zone:GetCoordinate():GetVec2() end + local randompositions = not PreciseLocation for _,_template in pairs(temptable) do self.TroopCounter = self.TroopCounter + 1 local alias = string.format("%s-%d", _template, math.random(1,100000)) self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias) - :InitRandomizeUnits(true,20,2) + :InitRandomizeUnits(randompositions,20,2) :InitDelayOff() :SpawnFromVec2(randomcoord) if self.movetroopstowpzone and type ~= CTLD_CARGO.Enum.ENGINEERS then