[Fix] Scout ai should probably work again.
This commit is contained in:
parent
2823f4df89
commit
5fe7753214
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user