From 668d120d60f9cc65413647ff30a6d639fca16f52 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 26 Aug 2024 18:22:32 +0200 Subject: [PATCH] CTLD Small fix for crate removal --- Moose Development/Moose/Ops/CTLD.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index d1332db63..5cfbe085a 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -2945,11 +2945,12 @@ end -- @param Wrapper.Unit#UNIT _unit Unit -- @param #number _dist Distance -- @param #boolean _ignoreweight Find everything in range, ignore loadable weight +-- @param #boolean ignoretype Find everything in range, ignore loadable type name -- @return #table Crates Table of crates -- @return #number Number Number of crates found -- @return #table CratesGC Table of crates possibly loaded by GC -- @return #number NumberGC Number of crates possibly loaded by GC -function CTLD:_FindCratesNearby( _group, _unit, _dist, _ignoreweight) +function CTLD:_FindCratesNearby( _group, _unit, _dist, _ignoreweight, ignoretype) self:T(self.lid .. " _FindCratesNearby") local finddist = _dist local location = _group:GetCoordinate() @@ -2962,7 +2963,7 @@ function CTLD:_FindCratesNearby( _group, _unit, _dist, _ignoreweight) local loadedmass = 0 local unittype = "none" local capabilities = {} - local maxmass = 2000 + --local maxmass = 2000 local maxloadable = 2000 local IsHook = self:IsHook(_unit) if not _ignoreweight then @@ -2984,6 +2985,7 @@ function CTLD:_FindCratesNearby( _group, _unit, _dist, _ignoreweight) --self:I(self.lid .. " Loading restricted: " .. tostring(restricted)) local staticpos = static:GetCoordinate() --or dcsunitpos local cando = cargo:UnitCanCarry(_unit) + if ignoretype == true then cando = true end --self:I(self.lid .. " Unit can carry: " .. tostring(cando)) --- Testing local distance = self:_GetDistance(location,staticpos)