Fixed AI_BALANCER problem with AI not patrolling...

-- Need to redo a video, because I gave the wrong example ...
This commit is contained in:
FlightControl
2017-01-12 12:19:23 +01:00
parent 2453fb6780
commit 6716f2907b
11 changed files with 118 additions and 41 deletions

View File

@@ -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.