Merge pull request #1287 from FlightControl-Master/Issue_#1286_SpawnNewFromTemplate

Fix for Issue #1286, partly tested.
This commit is contained in:
Frank 2020-03-11 10:50:23 +01:00 committed by GitHub
commit 4dc303a166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -326,6 +326,7 @@ function SPAWN:New( SpawnTemplatePrefix )
self.SpawnInitRadio = nil -- No radio comms setting. self.SpawnInitRadio = nil -- No radio comms setting.
self.SpawnInitModex = nil self.SpawnInitModex = nil
self.SpawnInitAirbase = nil self.SpawnInitAirbase = nil
self.TweakedTemplate = false -- Check if the user is using self made template.
self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned. self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned.
else else
@ -379,6 +380,7 @@ function SPAWN:NewWithAlias( SpawnTemplatePrefix, SpawnAliasPrefix )
self.SpawnInitRadio = nil -- No radio comms setting. self.SpawnInitRadio = nil -- No radio comms setting.
self.SpawnInitModex = nil self.SpawnInitModex = nil
self.SpawnInitAirbase = nil self.SpawnInitAirbase = nil
self.TweakedTemplate = false -- Check if the user is using self made template.
self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned. self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned.
else else
@ -435,6 +437,7 @@ function SPAWN:NewFromTemplate( SpawnTemplate, SpawnTemplatePrefix, SpawnAliasPr
self.SpawnInitRadio = nil -- No radio comms setting. self.SpawnInitRadio = nil -- No radio comms setting.
self.SpawnInitModex = nil self.SpawnInitModex = nil
self.SpawnInitAirbase = nil self.SpawnInitAirbase = nil
self.TweakedTemplate = true -- Check if the user is using self made template.
self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned. self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned.
else else
@ -2977,9 +2980,14 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) --R2.2
-- self.SpawnTemplate = self:_GetTemplate( SpawnTemplatePrefix ) -- self.SpawnTemplate = self:_GetTemplate( SpawnTemplatePrefix )
-- end -- end
local SpawnTemplate = self:_GetTemplate( SpawnTemplatePrefix ) local SpawnTemplate
--local SpawnTemplate = self.SpawnTemplate if self.TweakedTemplate ~= nil and self.TweakedTemplate == true then
SpawnTemplate.name = self:SpawnGroupName( SpawnIndex ) BASE:I("WARNING: You are using a tweaked template.")
SpawnTemplate = self.SpawnTemplate
else
SpawnTemplate = self:_GetTemplate( SpawnTemplatePrefix )
end
SpawnTemplate.groupId = nil SpawnTemplate.groupId = nil
--SpawnTemplate.lateActivation = false --SpawnTemplate.lateActivation = false