[Add] Check for weapon range when running away with turrets.

This commit is contained in:
Allanis 2013-07-06 20:01:49 +01:00
parent 04fc879ac8
commit 19cbc18ff3

View File

@ -52,7 +52,7 @@ function runaway()
ai.accel()
if ai.hasturrets() then
dist = ai.dist(ai.pos(target))
if dist < 300 then
if dist < ai.getweaprange() then
ai.settarget(target)
ai.shoot()
end