mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
- Have added cargo bay limits based on volume and weight.
- AI Cargo Dispatcher works with cargo bay limits for carrier. (i still need to add options to set the parameters for this). - Carriers load now multiple cargo. - Added weight and volume attached to cargo objects for units. I reworked the respawning of cargo units, so that these volumes and weights are collected from the unit Descriptor properties! - There are still bugs, which I need to resolve, but it is going in the right direction.
This commit is contained in:
@@ -868,6 +868,7 @@ do -- Cargo
|
||||
function POSITIONABLE:GetCargoBayFreeWeight()
|
||||
local CargoWeight = 0
|
||||
for CargoName, Cargo in pairs( self.__.Cargo ) do
|
||||
self:F( { Cargo = Cargo } )
|
||||
CargoWeight = CargoWeight + Cargo:GetWeight()
|
||||
end
|
||||
return self.__.CargoBayWeightLimit - CargoWeight
|
||||
@@ -883,7 +884,7 @@ do -- Cargo
|
||||
--- Get Cargo Bay Weight Limit in kg.
|
||||
-- @param #POSITIONABLE self
|
||||
-- @param #number WeightLimit
|
||||
function POSITIONABLE:GetCargoBayFreeWeightLimit( WeightLimit )
|
||||
function POSITIONABLE:SetCargoBayWeightLimit( WeightLimit )
|
||||
self.__.CargoBayWeightLimit = WeightLimit
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user