mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Fixed AI_BALANCER problem with AI not patrolling...
-- Need to redo a video, because I gave the wrong example ...
This commit is contained in:
@@ -591,6 +591,7 @@ function SPAWN:ReSpawn( SpawnIndex )
|
||||
|
||||
-- TODO: This logic makes DCS crash and i don't know why (yet).
|
||||
local SpawnGroup = self:GetGroupFromIndex( SpawnIndex )
|
||||
local WayPoints = SpawnGroup and SpawnGroup.WayPoints or nil
|
||||
if SpawnGroup then
|
||||
local SpawnDCSGroup = SpawnGroup:GetDCSObject()
|
||||
if SpawnDCSGroup then
|
||||
@@ -598,7 +599,15 @@ function SPAWN:ReSpawn( SpawnIndex )
|
||||
end
|
||||
end
|
||||
|
||||
return self:SpawnWithIndex( SpawnIndex )
|
||||
local SpawnGroup = self:SpawnWithIndex( SpawnIndex )
|
||||
if SpawnGroup and WayPoints then
|
||||
-- If there were WayPoints set, then Re-Execute those WayPoints!
|
||||
self:E( WayPoints )
|
||||
SpawnGroup:WayPointInitialize( WayPoints )
|
||||
SpawnGroup:WayPointExecute( 1, 5 )
|
||||
end
|
||||
|
||||
return SpawnGroup
|
||||
end
|
||||
|
||||
--- Will spawn a group with a specified index number.
|
||||
|
||||
Reference in New Issue
Block a user