Bugfix with Cargo

- Complex bug fix concerning CARGO_GROUPs loaded units in other clients.
- Complex bug fix concerning ReSpawning of CARGO_GROUPs when the mission
starts.
This commit is contained in:
svenvandevelde
2016-03-12 10:01:34 +01:00
parent dd5d5ed8fa
commit 4a5ebe147f
5 changed files with 64 additions and 31 deletions

View File

@@ -130,15 +130,24 @@ function DATABASE:Spawn( SpawnTemplate )
self:T( { SpawnTemplate.SpawnCountryID, SpawnTemplate.SpawnCategoryID, SpawnTemplate.name } )
-- Copy the spawn variables of the template in temporary storage, nullify, and restore the spawn variables.
local SpawnCoalitionID = SpawnTemplate.SpawnCoalitionID
local SpawnCountryID = SpawnTemplate.SpawnCountryID
local SpawnCategoryID = SpawnTemplate.SpawnCategoryID
-- Nullify
SpawnTemplate.SpawnCoalitionID = nil
SpawnTemplate.SpawnCountryID = nil
SpawnTemplate.SpawnCategoryID = nil
self:_RegisterGroup( SpawnTemplate )
coalition.addGroup( SpawnCountryID, SpawnCategoryID, SpawnTemplate )
-- Restore
SpawnTemplate.SpawnCoalitionID = SpawnCoalitionID
SpawnTemplate.SpawnCountryID = SpawnCountryID
SpawnTemplate.SpawnCategoryID = SpawnCategoryID
local SpawnGroup = GROUP:New( Group.getByName( SpawnTemplate.name ) )
return SpawnGroup