Finish Cargo/AI_Cargo_Helicopter

This commit is contained in:
FlightControl_Master
2018-05-19 06:12:37 +02:00
parent d07d063265
commit d05973f487
3 changed files with 43 additions and 18 deletions

View File

@@ -352,6 +352,17 @@ do -- CARGO
return self.Name
end
--- Get the current active object representing or being the Cargo.
-- @param #CARGO self
-- @return Wrapper.Positionable#POSITIONABLE The object representing or being the Cargo.
function CARGO:GetObject()
if self:IsLoaded() then
return self.CargoCarrier
else
return self.CargoObject
end
end
--- Get the object name of the Cargo.
-- @param #CARGO self
-- @return #string The object name of the Cargo.

View File

@@ -107,7 +107,7 @@ do -- CARGO_GROUP
self.CargoGroup = GROUP:NewTemplate( GroupTemplate, GroupTemplate.CoalitionID, GroupTemplate.CategoryID, GroupTemplate.CountryID)
-- Now we spawn the new group based on the template created.
_DATABASE:Spawn( GroupTemplate )
self.CargoObject = _DATABASE:Spawn( GroupTemplate )
self:SetWeight( WeightGroup )
self.CargoLimit = 10
@@ -169,7 +169,10 @@ do -- CARGO_GROUP
_DATABASE:Spawn( GroupTemplate )
end
end
self.CargoObject = nil
end
end
@@ -209,12 +212,12 @@ do -- CARGO_GROUP
end
-- Then we register the new group in the database
self.CargoGroup = GROUP:NewTemplate( GroupTemplate, GroupTemplate.CoalitionID, GroupTemplate.CategoryID, GroupTemplate.CountryID)
self.CargoGroup = GROUP:NewTemplate( GroupTemplate, GroupTemplate.CoalitionID, GroupTemplate.CategoryID, GroupTemplate.CountryID )
self:F( { "Regroup", GroupTemplate } )
-- Now we spawn the new group based on the template created.
_DATABASE:Spawn( GroupTemplate )
self.CargoObject = _DATABASE:Spawn( GroupTemplate )
end
end