diff --git a/Moose Development/Moose/AI/AI_Cargo.lua b/Moose Development/Moose/AI/AI_Cargo.lua index 1d358b735..9b0a8e6a1 100644 --- a/Moose Development/Moose/AI/AI_Cargo.lua +++ b/Moose Development/Moose/AI/AI_Cargo.lua @@ -143,6 +143,7 @@ function AI_CARGO:New( Carrier, CargoSet ) -- @param #string To for _, CarrierUnit in pairs( Carrier:GetUnits() ) do + local CarrierUnit = CarrierUnit -- Wrapper.Unit#UNIT CarrierUnit:SetCargoBayWeightLimit() end diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua index fc84e5f54..4a2dfc739 100644 --- a/Moose Development/Moose/Wrapper/Positionable.lua +++ b/Moose Development/Moose/Wrapper/Positionable.lua @@ -1022,8 +1022,9 @@ do -- Cargo -- @param #POSITIONABLE self -- @param #number WeightLimit function POSITIONABLE:SetCargoBayWeightLimit( WeightLimit ) + if WeightLimit then - self.__.CargoBayWeightLimit = WeightLimit + self.__.CargoBayWeightLimit = self.__.CargoBayWeightLimit or WeightLimit else -- If weightlimit is not provided, we will calculate it depending on the type of unit. @@ -1031,7 +1032,13 @@ do -- Cargo if self:IsAir() then local Desc = self:GetDesc() self:F({Desc=Desc}) - self.__.CargoBayWeightLimit = Desc.massMax - ( Desc.massEmpty + Desc.fuelMassMax ) + + local Weights = { + ["C-17A"] = 35000, --77519 cannot be used, because it loads way too much apcs and infantry., + ["C-130"] = 22000 --The real value cannot be used, because it loads way too much apcs and infantry., + } + + self.__.CargoBayWeightLimit = Weights[Desc.typeName] or ( Desc.massMax - ( Desc.massEmpty + Desc.fuelMassMax ) ) else local Desc = self:GetDesc()