X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=src%2Fai.c;h=a4d4fbe09d15b03e8f3d5747dd272e59dc1ff056;hb=c3d87a1dee96775443fdf73c53e1350af7ca5fc2;hp=aee8e738de50e245a40a057e513753723ba13eaf;hpb=75b0ee910d9a50de67e77ba40e877f9c8dabdd40;p=plomrogue diff --git a/src/ai.c b/src/ai.c index aee8e73..a4d4fbe 100644 --- a/src/ai.c +++ b/src/ai.c @@ -45,8 +45,7 @@ static void clockwise_path(char ** path_ptr) for (; i < len; i++) { uint8_t next_i = i + 1; - if ( next_i == len - || old_char != path[next_i]) + if (next_i == len || old_char != path[next_i]) { break; } @@ -67,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);