From: Christian Heller Date: Thu, 9 Oct 2014 23:03:31 +0000 (+0200) Subject: Server/AI: Correct variable name. X-Git-Tag: tce~627 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/te"st.html?a=commitdiff_plain;h=632b6d3e471fcdebbbf0d753a9ae3080b432e626;p=plomrogue Server/AI: Correct variable name. --- diff --git a/src/server/ai.c b/src/server/ai.c index ba93f4c..dd11f38 100644 --- a/src/server/ai.c +++ b/src/server/ai.c @@ -195,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; @@ -214,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;