diff --git a/Embedded/Moose_Embedded.lua b/Embedded/Moose_Embedded.lua index 7ab06e4d4..30ea0c6dd 100644 --- a/Embedded/Moose_Embedded.lua +++ b/Embedded/Moose_Embedded.lua @@ -11511,13 +11511,13 @@ function SPAWN:ReSpawn( SpawnIndex ) end -- TODO: This logic makes DCS crash and i don't know why (yet). --- local SpawnGroup = self:GetGroupFromIndex( SpawnIndex ) --- if SpawnGroup then --- local SpawnDCSGroup = SpawnGroup:GetDCSGroup() --- if SpawnDCSGroup then --- SpawnGroup:Destroy() --- end --- end + local SpawnGroup = self:GetGroupFromIndex( SpawnIndex ) + if SpawnGroup then + local SpawnDCSGroup = SpawnGroup:GetDCSGroup() + if SpawnDCSGroup then + SpawnGroup:Destroy() + end + end return self:SpawnWithIndex( SpawnIndex ) end diff --git a/Moose/Spawn.lua b/Moose/Spawn.lua index 9ad27e90e..c82e88ec8 100644 --- a/Moose/Spawn.lua +++ b/Moose/Spawn.lua @@ -418,13 +418,13 @@ function SPAWN:ReSpawn( SpawnIndex ) end -- TODO: This logic makes DCS crash and i don't know why (yet). --- local SpawnGroup = self:GetGroupFromIndex( SpawnIndex ) --- if SpawnGroup then --- local SpawnDCSGroup = SpawnGroup:GetDCSGroup() --- if SpawnDCSGroup then --- SpawnGroup:Destroy() --- end --- end + local SpawnGroup = self:GetGroupFromIndex( SpawnIndex ) + if SpawnGroup then + local SpawnDCSGroup = SpawnGroup:GetDCSGroup() + if SpawnDCSGroup then + SpawnGroup:Destroy() + end + end return self:SpawnWithIndex( SpawnIndex ) end diff --git a/Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua b/Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua index 6b2c96c5e..5b832af72 100644 --- a/Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua +++ b/Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua @@ -77,7 +77,7 @@ Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limit -- Tests the CleanUp functionality. -- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground. -- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn. -Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 ) +Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 60 ):SpawnScheduled( 10, 0 ) Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 ) -- Maykop diff --git a/Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz b/Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz index 4a1b110f2..56f294d0a 100644 Binary files a/Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz and b/Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz differ