home · contact · privacy
Server/C: Fix bug of ignoring wait set by get_dir_from_neighbors().
[plomrogue] / src / server / ai.c
index 1a296ce18ffc7038bed075d77da719be39d817ef..749a3858afaa4078e9fa0357e9f4cbfde9f1958c 100644 (file)
@@ -378,7 +378,7 @@ static uint8_t get_dir_to_nearest_target(struct Thing * t_eye, char filter)
         dijkstra_map(score_map, UINT16_MAX-1);
         dir_to_nearest_target = get_dir_from_neighbors(filter,t_eye,score_map);
         free(score_map);
-        if (dir_to_nearest_target)
+        if (dir_to_nearest_target && 1 != dir_to_nearest_target)
         {
             t_eye->command = get_thing_action_id_by_name(s[S_CMD_MOVE]);
             t_eye->arg = dir_to_nearest_target;