[Change] "runaway" takes priority over attacking.

This commit is contained in:
Allanis 2013-12-05 02:18:44 +00:00
parent 0ce93217da
commit 6d8b591a48

View File

@ -33,11 +33,6 @@ function control()
attack_think()
end
-- Enemy sighted.
elseif enemy ~= nil and aggressive then
taunt(enemy, true)
ai.pushtask(0, "attack", enemy)
-- Pilot is running away.
elseif task == "runaway" then
dist = ai.dist(ai.pos(ai.targetid()))
@ -51,6 +46,11 @@ function control()
ai.hyperspace()
end
-- Enemy sighted, handled after running away.
elseif enemy ~= nil and aggressive then
taunt(enemy, true)
ai.pushtask(0, "attack", enemy)
-- Enter hyperspace if possible.
elseif task == "hyperspace" then
ai.hyperspace() -- Try to hyperspace.