Progress on the new cargo group movements

This commit is contained in:
FlightControl_Master
2018-03-24 07:32:04 +01:00
parent 25659647a6
commit ca32c57c52
3 changed files with 47 additions and 18 deletions

View File

@@ -193,10 +193,12 @@ end
-- @param #number Heading The heading of the unit respawn.
function UNIT:ReSpawn( SpawnVec3, Heading )
self:T( self:Name() )
local SpawnGroupTemplate = UTILS.DeepCopy( _DATABASE:GetGroupTemplateFromUnitName( self:Name() ) )
self:T( SpawnGroupTemplate )
local SpawnGroup = self:GetGroup()
self:T( { SpawnGroup = SpawnGroup } )
if SpawnGroup then
@@ -221,7 +223,7 @@ function UNIT:ReSpawn( SpawnVec3, Heading )
end
for UnitTemplateID, UnitTemplateData in pairs( SpawnGroupTemplate.units ) do
self:T( UnitTemplateData.name )
self:T( { UnitTemplateData.name, self:Name() } )
if UnitTemplateData.name == self:Name() then
self:T("Adjusting")
SpawnGroupTemplate.units[UnitTemplateID].alt = SpawnVec3.y
@@ -261,6 +263,8 @@ function UNIT:ReSpawn( SpawnVec3, Heading )
i = i + 1
end
end
self:T( SpawnGroupTemplate )
_DATABASE:Spawn( SpawnGroupTemplate )
end