From 1a156e7e1204b90f35330dcde53491a89979d678 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 7 Apr 2025 11:57:15 +0200 Subject: [PATCH] #CTLD - make menu build for CA a bit faster --- Moose Development/Moose/Ops/CTLD.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index 565c9bf1a..cd0bc8403 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -1412,7 +1412,7 @@ CTLD.FixedWingTypes = { --- CTLD class version. -- @field #string version -CTLD.version="1.1.32" +CTLD.version="1.2.33" --- Instantiate a new CTLD. -- @param #CTLD self @@ -2059,6 +2059,12 @@ function CTLD:_EventHandler(EventData) self.Loaded_Cargo[unitname] = nil self:_RefreshF10Menus() end + -- CA support + if _unit:IsGround() and self.allowCATransport then + local unitname = event.IniUnitName or "none" + self.Loaded_Cargo[unitname] = nil + self:_RefreshF10Menus() + end return elseif event.id == EVENTS.Land or event.id == EVENTS.Takeoff then local unitname = event.IniUnitName @@ -4141,6 +4147,7 @@ function CTLD:_MoveGroupToZone(Group) local groupcoord = Group:GetCoordinate() -- Get closest zone of type local outcome, name, zone, distance = self:IsUnitInZone(Group,CTLD.CargoZoneType.MOVE) + self:T({canmove=outcome, name=name, zone=zone, dist=distance,max=self.movetroopsdistance}) if (distance <= self.movetroopsdistance) and outcome == true and zone~= nil then -- yes, we can ;) local groupname = Group:GetName() @@ -5240,6 +5247,8 @@ function CTLD:ActivateZone(Name,ZoneType,NewState) table = self.dropOffZones elseif ZoneType == CTLD.CargoZoneType.SHIP then table = self.shipZones + elseif ZoneType == CTLD.CargoZoneType.BEACON then + table = self.droppedBeacons else table = self.wpZones end @@ -5672,7 +5681,8 @@ function CTLD:IsUnitInZone(Unit,Zonetype) end local distance = self:_GetDistance(zonecoord,unitcoord) self:T("Distance Zone: "..distance) - if (zone:IsVec2InZone(unitVec2) or Zonetype == CTLD.CargoZoneType.MOVE) and active == true and maxdist > distance then + self:T("Zone Active: "..tostring(active)) + if (zone:IsVec2InZone(unitVec2) or Zonetype == CTLD.CargoZoneType.MOVE) and active == true and distance < maxdist then outcome = true maxdist = distance zoneret = zone