mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Fixed error in SPAWN:RandomizeTemplate()
-- Units started in wrong x, y position (at the template, instead of at the master template of the SPAWN). -- Adjusted x, y and alt to the start position of the first unit of the master template. -- Added a test mission Moose_Test_SPAWN_RandomizeTemplate. -- Regenerated MOOSE.lua
This commit is contained in:
@@ -117,7 +117,7 @@ SPAWN = {
|
||||
-- Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' )
|
||||
-- @usage local Plane = SPAWN:New( "Plane" ) -- Creates a new local variable that can initiate new planes with the name "Plane#ddd" using the template "Plane" as defined within the ME.
|
||||
function SPAWN:New( SpawnTemplatePrefix )
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
local self = BASE:Inherit( self, BASE:New() ) -- #SPAWN
|
||||
self:F( { SpawnTemplatePrefix } )
|
||||
|
||||
local TemplateGroup = Group.getByName( SpawnTemplatePrefix )
|
||||
@@ -1095,6 +1095,9 @@ function SPAWN:_RandomizeTemplate( SpawnIndex )
|
||||
self.SpawnGroups[SpawnIndex].SpawnTemplate.start_time = self.SpawnTemplate.start_time
|
||||
for UnitID = 1, #self.SpawnGroups[SpawnIndex].SpawnTemplate.units do
|
||||
self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].heading = self.SpawnTemplate.units[1].heading
|
||||
self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].x = self.SpawnTemplate.units[1].x
|
||||
self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].y = self.SpawnTemplate.units[1].y
|
||||
self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].alt = self.SpawnTemplate.units[1].alt
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user