home · contact · privacy
Fixed bug that led to endless loop in nearest_enemy_dir().
[plomrogue] / src / ai.c
index 7efacf240293c17d9cc06f96e910ffccf75401c0..a4d4fbe09d15b03e8f3d5747dd272e59dc1ff056 100644 (file)
--- a/src/ai.c
+++ b/src/ai.c
@@ -66,7 +66,8 @@ static char nearest_enemy_dir(struct yx_uint16 origin)
         dist_max = world.map->size.x;
     }
     uint8_t escape = 0;
-    uint8_t dist, i, j;
+    uint8_t dist, j;
+    uint16_t i;
     for (dist = 1; !escape && dist <= dist_max; dist++)
     {
         char * path = try_malloc(dist + 1, f_name);