mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
BIGFIX: InitRandomizeTemplate is now correctly positioning the Spawned Units.
-- Fixed in spawn.lua -- InitRandomizeTemplate is now correctly positioning the spawned units according the initial position as modeled in the mission editor. -- When combining InitRandomizeTemplate with InitRandomizeZone, the spawned units are still positioned at their initial position according the position modeled in the mission editor. -- Added test missions SPA-019 and SPA-020.
This commit is contained in:
@@ -1304,10 +1304,12 @@ function SPAWN:_RandomizeTemplate( SpawnIndex )
|
||||
self.SpawnGroups[SpawnIndex].SpawnTemplate.x = self.SpawnTemplate.x
|
||||
self.SpawnGroups[SpawnIndex].SpawnTemplate.y = self.SpawnTemplate.y
|
||||
self.SpawnGroups[SpawnIndex].SpawnTemplate.start_time = self.SpawnTemplate.start_time
|
||||
local OldX = self.SpawnGroups[SpawnIndex].SpawnTemplate.units[1].x
|
||||
local OldY = self.SpawnGroups[SpawnIndex].SpawnTemplate.units[1].y
|
||||
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].x = self.SpawnTemplate.units[1].x + ( self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].x - OldX )
|
||||
self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].y = self.SpawnTemplate.units[1].y + ( self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].y - OldY )
|
||||
self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].alt = self.SpawnTemplate.units[1].alt
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user