Fix the bogus getAirstrikeTarget methods of the nod08 missions

They always searched 6 times even after finding a target.
Now they also account for SAM sites (like in the previous missions).
This commit is contained in:
abcdefg30
2016-05-23 22:06:17 +02:00
parent 6682a4e97e
commit 6637c20c59
2 changed files with 16 additions and 4 deletions

View File

@@ -50,12 +50,18 @@ getAirstrikeTarget = function()
local target = list[DateTime.GameTime % #list + 1].CenterPosition
if searches < 6 then
local sams = Map.ActorsInCircle(target, WDist.New(8 * 1024), function(actor)
return actor.Type == "sam" end)
if #sams == 0 then
searches = 0
return target
elseif searches < 6 then
searches = searches + 1
return getAirstrikeTarget()
else
searches = 0
return target
return nil
end
end

View File

@@ -51,12 +51,18 @@ getAirstrikeTarget = function()
local target = list[DateTime.GameTime % #list + 1].CenterPosition
if searches < 6 then
local sams = Map.ActorsInCircle(target, WDist.New(8 * 1024), function(actor)
return actor.Type == "sam" end)
if #sams == 0 then
searches = 0
return target
elseif searches < 6 then
searches = searches + 1
return getAirstrikeTarget()
else
searches = 0
return target
return nil
end
end