Fixed off-by-two error
authorJustin Worthe <justin.worthe@entelect.co.za>
Sun, 20 Oct 2013 18:22:56 +0000 (20:22 +0200)
committerJustin Worthe <justin.worthe@entelect.co.za>
Sun, 20 Oct 2013 18:22:56 +0000 (20:22 +0200)
Entelect.BattleCity.Challenge/AiAgent.cs

index 02ebd3b..56035e1 100644 (file)
@@ -66,14 +66,14 @@ namespace Entelect.BattleCity.Challenge
             var enemyBase = enemy.@base;
 
             ChallengeService.direction chosenDirection = 
-                tank.y+2 != enemyBase.y ?
+                tank.y != enemyBase.y ?
                 (
-                    tank.y+2 > enemyBase.y ?
+                    tank.y > enemyBase.y ?
                     ChallengeService.direction.UP :
                     ChallengeService.direction.DOWN
                 ) :
                 (
-                    tank.x+2 > enemyBase.x ?
+                    tank.x > enemyBase.x ?
                     ChallengeService.direction.LEFT :
                     ChallengeService.direction.RIGHT
                 );