[Fix] Scout ai should probably work again.

This commit is contained in:
Allanis 2013-12-15 00:50:54 +00:00
parent 2823f4df89
commit 5fe7753214

View File

@ -23,11 +23,12 @@ function control()
-- Nothing to do so check if we are too far from the planet.
-- (If there is one).
planet = ai.rndplanet()
mem.approach = ai.rndplanet()
planet = mem.approach
if planet ~= nil then
if ai.dist(planet) > planet_dist then
ai.pushtask(0, "approach", planet)
ai.pushtask(0, "approach")
return
end
end
@ -40,7 +41,7 @@ function control()
-- Check if we are near enough.
elseif task == "approach" then
planet = ai.target()
planet = mem.approach
if ai.dist(planet) < planet_dist + ai.minbrakedist() then
ai.poptask()
@ -89,7 +90,7 @@ end
-- Approaches the target.
function approach()
target = ai.target()
target = mem.approach
ai.face(target)
ai.accel()
end