From 6d8b591a4891d2c5c56ca253039a518c1ad12b09 Mon Sep 17 00:00:00 2001 From: Allanis Date: Thu, 5 Dec 2013 02:18:44 +0000 Subject: [PATCH] [Change] "runaway" takes priority over attacking. --- scripts/ai/tpl/generic.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/ai/tpl/generic.lua b/scripts/ai/tpl/generic.lua index 7e9e67c..d71bdea 100644 --- a/scripts/ai/tpl/generic.lua +++ b/scripts/ai/tpl/generic.lua @@ -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.