Teleport AI:
authormbait
Thu, 06 May 2010 20:49:26 +0000
changeset 3438 670324167e42
parent 3437 858105ae769c
child 3439 a98984e4f458
Teleport AI: * check if teleport target not higher then screen top
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Thu May 06 18:01:04 2010 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Thu May 06 20:49:26 2010 +0000
@@ -653,7 +653,7 @@
   if bonuses.Count = 0 then begin
     if Me^.Health <= 100  then begin
 	  maxTop := Targ.Y - cHHRadius * 2; 
-	  while(not TestColl(Targ.X, maxTop, cHHRadius) and (maxTop > topY)) do
+	  while(not TestColl(Targ.X, maxTop, cHHRadius) and (maxTop > topY + cHHRadius * 2 + 1)) do
 	  	dec(maxTop, cHHRadius*2);
 	  if(not TestColl(Targ.X, maxTop + cHHRadius, cHHRadius)) then begin
         ap.AttackPutX := Targ.X;