Improvement of the C-130 and C-17A

This commit is contained in:
FlightControl 2018-09-17 11:17:59 +02:00
parent f5a68db7ef
commit f8e1c21a13
2 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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()