[Change] "runaway" takes priority over attacking.
This commit is contained in:
parent
0ce93217da
commit
6d8b591a48
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user