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:
@@ -50,12 +50,18 @@ getAirstrikeTarget = function()
|
|||||||
|
|
||||||
local target = list[DateTime.GameTime % #list + 1].CenterPosition
|
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
|
searches = searches + 1
|
||||||
return getAirstrikeTarget()
|
return getAirstrikeTarget()
|
||||||
else
|
else
|
||||||
searches = 0
|
searches = 0
|
||||||
return target
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -51,12 +51,18 @@ getAirstrikeTarget = function()
|
|||||||
|
|
||||||
local target = list[DateTime.GameTime % #list + 1].CenterPosition
|
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
|
searches = searches + 1
|
||||||
return getAirstrikeTarget()
|
return getAirstrikeTarget()
|
||||||
else
|
else
|
||||||
searches = 0
|
searches = 0
|
||||||
return target
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user