X-Git-Url: https://plomlompom.com/repos/index.html?a=blobdiff_plain;ds=sidebyside;f=src%2Fserver%2Fai.c;h=dd11f38deab002a4694d84f649ba4fe348dbf8be;hb=a98069786c81fe3ece3f4f1472877dd31bbccd90;hp=630c2dbe20a9b342049c6d5470b0226484bb081c;hpb=491e8bc8e7a9b1d312256817c0b8be7e05b127be;p=plomrogue
diff --git a/src/server/ai.c b/src/server/ai.c
index 630c2db..dd11f38 100644
--- a/src/server/ai.c
+++ b/src/server/ai.c
@@ -1,4 +1,9 @@
-/* src/server/ai.c */
+/* src/server/ai.c
+ *
+ * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
+ * or any later version. For details on its copyright, license, and warranties,
+ * see the file NOTICE in the root directory of the PlomRogue source package.
+ */
#include "ai.h"
#include /* uint8_t, uint16_t, uint32_t, int16_t, UINT16_MAX */
@@ -190,7 +195,7 @@ static void init_score_map(char filter, uint16_t * score_map, uint32_t map_size,
static uint8_t get_dir_to_nearest_thing(struct Thing * t_eye, char filter)
{
- char dir_to_nearest_enemy = 0;
+ char dir_to_nearest_thing = 0;
if (seeing_thing(t_eye, filter))
{
uint32_t map_size = world.map.length * world.map.length;
@@ -209,14 +214,14 @@ static uint8_t get_dir_to_nearest_thing(struct Thing * t_eye, char filter)
if (min_neighbor > neighbors[i])
{
min_neighbor = neighbors[i];
- dir_to_nearest_enemy = dirs[i];
+ dir_to_nearest_thing = dirs[i];
}
}
}
- if (dir_to_nearest_enemy)
+ if (dir_to_nearest_thing)
{
t_eye->command = get_thing_action_id_by_name(s[S_CMD_MOVE]);
- t_eye->arg = dir_to_nearest_enemy;
+ t_eye->arg = dir_to_nearest_thing;
return 1;
}
return 0;