[Change] "runaway" takes priority over attacking.
This commit is contained in:
parent
0ce93217da
commit
6d8b591a48
@ -33,11 +33,6 @@ function control()
|
|||||||
attack_think()
|
attack_think()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Enemy sighted.
|
|
||||||
elseif enemy ~= nil and aggressive then
|
|
||||||
taunt(enemy, true)
|
|
||||||
ai.pushtask(0, "attack", enemy)
|
|
||||||
|
|
||||||
-- Pilot is running away.
|
-- Pilot is running away.
|
||||||
elseif task == "runaway" then
|
elseif task == "runaway" then
|
||||||
dist = ai.dist(ai.pos(ai.targetid()))
|
dist = ai.dist(ai.pos(ai.targetid()))
|
||||||
@ -51,6 +46,11 @@ function control()
|
|||||||
ai.hyperspace()
|
ai.hyperspace()
|
||||||
end
|
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.
|
-- Enter hyperspace if possible.
|
||||||
elseif task == "hyperspace" then
|
elseif task == "hyperspace" then
|
||||||
ai.hyperspace() -- Try to hyperspace.
|
ai.hyperspace() -- Try to hyperspace.
|
||||||
|
Loading…
Reference in New Issue
Block a user