mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Fix for clients which weren't initialized with a cargo bay weight limit value. Each time a cargo bay weight limit is enquired through the method GetCargoBayFeeWeight(), if there isn't a cargo bay weight limit set, the default cargo bay weight limit will be calculated, so that the logic will always be executed.
This commit is contained in:
@@ -946,6 +946,12 @@ do -- Cargo
|
||||
-- @param #POSITIONABLE self
|
||||
-- @return #number CargoBayFreeWeight
|
||||
function POSITIONABLE:GetCargoBayFreeWeight()
|
||||
|
||||
-- When there is no cargo bay weight limit set, then calculate this for this positionable!
|
||||
if not self.__.CargoBayWeightLimit then
|
||||
self:SetCargoBayWeightLimit()
|
||||
end
|
||||
|
||||
local CargoWeight = 0
|
||||
for CargoName, Cargo in pairs( self.__.Cargo ) do
|
||||
CargoWeight = CargoWeight + Cargo:GetWeight()
|
||||
@@ -1007,6 +1013,7 @@ do -- Cargo
|
||||
self.__.CargoBayWeightLimit = CargoBayWeightLimit
|
||||
end
|
||||
end
|
||||
self:F({CargoBayWeightLimit = self.__.CargoBayWeightLimit})
|
||||
end
|
||||
end --- Cargo
|
||||
|
||||
|
||||
Reference in New Issue
Block a user