Skip to content

Commit b33890f

Browse files
Merge pull request #2613 from FlightControl-Master/master-ng
Merge
2 parents 4e3bf99 + 1be2c92 commit b33890f

2 files changed

Lines changed: 62 additions & 18 deletions

File tree

Moose Development/Moose/Ops/CTLD.lua

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3747,16 +3747,16 @@ function CTLD:_C130GetUnits(Group, Unit, Name)
37473747
return self
37483748
end
37493749

3750-
local coord = Unit:GetCoordinate() or Group:GetCoordinate()
3750+
local coord = Unit:GetCoord() or Group:GetCoord()
37513751
local capabilities = self:_GetUnitCapabilities(Unit)
37523752
local innerDist = (capabilities.length and capabilities.length/2) or 15
37533753
local maxUnitsNearby = self.maxUnitsNearby or 3
37543754
local searchRadius = self.UnitDistance or 90
37553755
local checkZone = ZONE_RADIUS:New("CTLD_C130UnitsZone",coord:GetVec2(),searchRadius,false)
3756-
local nearGroups = SET_GROUP:New():FilterCoalitions("blue"):FilterZones({checkZone}):FilterOnce()
3756+
local nearGroups = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterZones({checkZone}):FilterOnce()
37573757
local nearbyCount = 0
37583758
for _,gr in pairs(nearGroups.Set) do
3759-
local gc = gr:GetCoordinate()
3759+
local gc = gr:GetCoord()
37603760
if gc then
37613761
local dist = coord:Get2DDistance(gc)
37623762
if dist > innerDist then
@@ -3925,7 +3925,7 @@ function CTLD:_GetCrates(Group, Unit, Cargo, number, drop, pack, quiet, suppress
39253925
-- Check cargo location if available
39263926
local location = Cargo:GetLocation()
39273927
if location then
3928-
local unitcoord = Unit:GetCoordinate() or Group:GetCoordinate()
3928+
local unitcoord = Unit:GetCoord() or Group:GetCoord()
39293929
if unitcoord then
39303930
if not location:IsCoordinateInZone(unitcoord) then
39313931
-- no we're not at the right spot
@@ -4136,8 +4136,8 @@ function CTLD:_GetCrates(Group, Unit, Cargo, number, drop, pack, quiet, suppress
41364136
if type(ship) == "string" then
41374137
self:T("Spawning on ship "..ship)
41384138
local Ship = UNIT:FindByName(ship)
4139-
local shipcoord = Ship:GetCoordinate()
4140-
local unitcoord = Unit:GetCoordinate()
4139+
local shipcoord = Ship:GetCoord()
4140+
local unitcoord = Unit:GetCoord()
41414141
local dist = shipcoord:Get2DDistance(unitcoord)
41424142
dist = dist - (20 + math.random(1, 10))
41434143
local halfwidth = (width or 20) / 2
@@ -4395,11 +4395,11 @@ function CTLD:_C130RemoveUnitsNearby(_group,_unit)
43954395
local innerDist = (capabilities.length and capabilities.length/2) or 15
43964396
local finddist = self.PackDistance or (self.CrateDistance or 35)
43974397
local zone = ZONE_RADIUS:New("CTLD_C130RemoveZone",location:GetVec2(),finddist,false)
4398-
local nearestGroups = SET_GROUP:New():FilterCoalitions("blue"):FilterZones({zone}):FilterOnce()
4398+
local nearestGroups = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterZones({zone}):FilterOnce()
43994399
local removedAny = false
44004400
local removedTable = {}
44014401
for _, gr in pairs(nearestGroups.Set) do
4402-
local gc = gr:GetCoordinate()
4402+
local gc = gr:GetCoord()
44034403
if gc then
44044404
local dist = location:Get2DDistance(gc)
44054405
if dist > innerDist then
@@ -5683,18 +5683,18 @@ end
56835683
-- @return #number Number
56845684
function CTLD:_FindPackableGroupsNearby(Group, Unit)
56855685
self:T(self.lid .. " _FindPackableGroupsNearby")
5686-
local location = Group:GetCoordinate()
5686+
local location = Group:GetCoord()
56875687
if not location then return {}, 0 end
56885688
local capabilities = self:_GetUnitCapabilities(Unit)
56895689
local innerDist = (capabilities.length and capabilities.length/2) or 15
56905690
local finddist = self.PackDistance or (self.CrateDistance or 35)
56915691
local zone = ZONE_RADIUS:New("CTLD_PackableZone", location:GetVec2(), finddist, false)
5692-
local nearestGroups = SET_GROUP:New():FilterCoalitions("blue"):FilterZones({zone}):FilterOnce()
5692+
local nearestGroups = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterZones({zone}):FilterOnce()
56935693
local packable = {}
56945694

56955695
for _, gr in pairs(nearestGroups.Set) do
56965696
if gr and gr:GetName() ~= Group:GetName() then
5697-
local gc = gr:GetCoordinate()
5697+
local gc = gr:GetCoord()
56985698
if gc then
56995699
local dist = location:Get2DDistance(gc)
57005700
if dist > innerDist and dist <= finddist then
@@ -6171,11 +6171,11 @@ function CTLD:_BuildObjectFromCrates(Group,Unit,Build,Repair,RepairLocation,Mult
61716171
local ctype = Build.Type -- #CTLD_CARGO.Enum
61726172
local canmove = false
61736173
if ctype == CTLD_CARGO.Enum.VEHICLE then canmove = true end
6174-
if ctype == CTLD_CARGO.Enum.STATIC then
6175-
return self
6174+
if ctype == CTLD_CARGO.Enum.STATIC then
6175+
return self
61766176
end
61776177
local temptable = Build.Template or {}
6178-
if type(temptable) == "string" then
6178+
if type(temptable) == "string" then
61796179
temptable = {temptable}
61806180
end
61816181
local zone = nil -- Core.Zone#ZONE_RADIUS
@@ -6217,8 +6217,11 @@ function CTLD:_BuildObjectFromCrates(Group,Unit,Build,Repair,RepairLocation,Mult
62176217
self:__CratesBuild(1,Group,Unit,self.DroppedTroops[self.TroopCounter])
62186218
end
62196219
end -- template loop
6220-
self:_RefreshLoadCratesMenu(Group, Unit)
6221-
self:_RefreshPackMenus(Group, Unit)
6220+
6221+
if Group and Group:IsAlive() and Group:GetID() then
6222+
self:_RefreshLoadCratesMenu(Group, Unit)
6223+
self:_RefreshPackMenus(Group, Unit)
6224+
end
62226225
else
62236226
self:T(self.lid.."Group KIA while building!")
62246227
end
@@ -9008,7 +9011,7 @@ function CTLD:IsUnitInZone(Unit,Zonetype)
90089011
local zoneret = nil
90099012
local zonewret = nil
90109013
local zonenameret = nil
9011-
local unitcoord = Unit:GetCoordinate()
9014+
local unitcoord = Unit:GetCoord()
90129015
if not unitcoord then
90139016
if Zonetype == CTLD.CargoZoneType.SHIP then
90149017
return false, nil, nil, 1000000, nil
@@ -9029,7 +9032,7 @@ function CTLD:IsUnitInZone(Unit,Zonetype)
90299032
self:T("Checking Type Ship: "..zonename)
90309033
local ZoneUNIT = UNIT:FindByName(zonename)
90319034
if not ZoneUNIT then return false end
9032-
zonecoord = ZoneUNIT:GetCoordinate()
9035+
zonecoord = ZoneUNIT:GetCoord()
90339036
zoneradius = czone.shiplength
90349037
zonewidth = czone.shipwidth
90359038
zone = ZONE_UNIT:New( ZoneUNIT:GetName(), ZoneUNIT, zoneradius/2)

Moose Development/Moose/Utilities/Enums.lua

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,6 +2126,47 @@ ENUMS.Storage.weapons.containers.UH60_GAU19_RIGHT = 'weapons.containers.{UH60_GA
21262126
ENUMS.Storage.weapons.containers.UH60_M230_RIGHT = 'weapons.containers.{UH60_M230_RIGHT}'
21272127
ENUMS.Storage.weapons.containers.UH60L_M2_GUNNER = 'weapons.containers.{UH60L_M2_GUNNER}'
21282128

2129+
2130+
ENUMS.Storage.weapons.adapters.GD_F100_SUU_13 = 'weapons.adapters.GD_F100_SUU-13'
2131+
ENUMS.Storage.weapons.containers.GPU_5_POD = 'weapons.containers.{GPU_5_POD}'
2132+
ENUMS.Storage.weapons.bombs.BOLT_117 = 'weapons.bombs.BOLT-117'
2133+
ENUMS.Storage.weapons.shells.F100_M39_20_TP_T = 'weapons.shells.F100_M39_20_TP_T'
2134+
ENUMS.Storage.weapons.gunmounts.M_39_F_100 = 'weapons.gunmounts.M-39 F-100'
2135+
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_275_L = 'weapons.droptanks.GD_F100_TANK_275_L'
2136+
ENUMS.Storage.weapons.bombs.BLU_4B_R_GROUP_R = 'weapons.bombs.BLU-4B_R_GROUP_R'
2137+
ENUMS.Storage.weapons.containers.F100_CAMERA_P2 = 'weapons.containers.F100_CAMERA_P2'
2138+
ENUMS.Storage.weapons.containers.HB_ORD_SUU_7 = 'weapons.containers.HB_ORD_SUU_7'
2139+
ENUMS.Storage.weapons.adapters.SidewinderPylon = 'weapons.adapters.SidewinderPylon'
2140+
ENUMS.Storage.weapons.adapters.apu_470 = 'weapons.adapters.apu_470'
2141+
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_335_R = 'weapons.droptanks.GD_F100_TANK_335_R'
2142+
ENUMS.Storage.weapons.bombs.BLU_3B_R_GROUP_R = 'weapons.bombs.BLU-3B_R_GROUP_R'
2143+
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_335_L = 'weapons.droptanks.GD_F100_TANK_335_L'
2144+
ENUMS.Storage.weapons.adapters.mbdz_u2t = 'weapons.adapters.mbdz_u2t'
2145+
ENUMS.Storage.weapons.containers.ZellRocket = 'weapons.containers.ZellRocket'
2146+
ENUMS.Storage.weapons.containers.apu_73 = 'weapons.containers.apu-73'
2147+
ENUMS.Storage.weapons.gunmounts.GAU_13 = 'weapons.gunmounts.GAU-13'
2148+
ENUMS.Storage.weapons.shells.F100_M39_20_TP = 'weapons.shells.F100_M39_20_TP'
2149+
ENUMS.Storage.weapons.shells.F100_M39_20_API = 'weapons.shells.F100_M39_20_API'
2150+
ENUMS.Storage.weapons.adapters.bdz_umk2b = 'weapons.adapters.bdz_umk2b'
2151+
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_450 = 'weapons.droptanks.GD_F100_TANK_450'
2152+
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_275_R = 'weapons.droptanks.GD_F100_TANK_275_R'
2153+
ENUMS.Storage.weapons.bombs.BLU_18_B_GROUP = 'weapons.bombs.BLU-18/B_GROUP'
2154+
ENUMS.Storage.weapons.containers.ZELL_Booster = 'weapons.containers.ZELL Booster'
2155+
ENUMS.Storage.weapons.adapters.apu_60 = 'weapons.adapters.apu_60'
2156+
ENUMS.Storage.weapons.gunmounts.GPU_5_POD = 'weapons.gunmounts.{GPU_5_POD}'
2157+
ENUMS.Storage.weapons.containers.F100_CAMERA_KA71A = 'weapons.containers.F100_CAMERA_KA71A'
2158+
ENUMS.Storage.weapons.bombs.BLU_3_R_GROUP_R = 'weapons.bombs.BLU-3_R_GROUP_R'
2159+
ENUMS.Storage.weapons.shells.F100_M39_20_HEI = 'weapons.shells.F100_M39_20_HEI'
2160+
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_200 = 'weapons.droptanks.GD_F100_TANK_200'
2161+
ENUMS.Storage.weapons.adapters.apu_73 = 'weapons.adapters.apu-73'
2162+
ENUMS.Storage.weapons.gunmounts.AKAN_NO_TRC = 'weapons.gunmounts.AKAN_NO_TRC'
2163+
ENUMS.Storage.weapons.gunmounts.AKAN = 'weapons.gunmounts.AKAN'
2164+
ENUMS.Storage.weapons.shells.F100_M39_20_HEI_T = 'weapons.shells.F100_M39_20_HEI_T'
2165+
ENUMS.Storage.weapons.shells.F100_M39_20_API_T = 'weapons.shells.F100_M39_20_API_T'
2166+
ENUMS.Storage.weapons.containers.GD_F100_STRIKE_CAMERA = 'weapons.containers.GD_F100_STRIKE_CAMERA'
2167+
ENUMS.Storage.weapons.bombs.BLU_49_B = 'weapons.bombs.BLU-49/B'
2168+
ENUMS.Storage.weapons.containers.GD_F100_SUU_13 = 'weapons.containers.GD_F100_SUU-13'
2169+
21292170
---
21302171
-- @type ENUMS.FARPType
21312172
-- @field #string FARP

0 commit comments

Comments
 (0)