From e40a9ecbf728a17de3cd2ce69d12e825941cf2ff Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Wed, 1 Jan 2014 01:13:14 +0000
Subject: [PATCH] [Change] AI aims earliar, much more accurate now.

---
 scripts/ai/include/attack_generic.lua | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/ai/include/attack_generic.lua b/scripts/ai/include/attack_generic.lua
index ce5d3b7..829e9e5 100644
--- a/scripts/ai/include/attack_generic.lua
+++ b/scripts/ai/include/attack_generic.lua
@@ -15,7 +15,7 @@ function atk_g_think()
     range = ai.getweaprange()
 
     -- Shouldn't switch targets if close.
-    if dist > range * 1.3 then
+    if dist > range * 1.6 then
       ai.poptask()
       ai.pushtask(0, "attack", enemy)
     end
@@ -41,7 +41,7 @@ function atk_g()
   range = ai.getweaprange()
 
   -- We first bias towards range.
-  if dist > range then
+  if dist > range*1.3 then
     dir = ai.face(target) -- Normal face the target.
 
     secondary, special, ammo = ai.secondary("Launcher")
@@ -75,7 +75,7 @@ function atk_g()
       end
     end
 
-    if dir < 10 or ai.hasturrets() then
+    if(dir < 10 and dist < range) or ai.hasturrets() then
       ai.shoot()
     end
   end