From b0a9d789500175b7433e98c5aa8d90a5bd3512a2 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 5 Mar 2021 06:07:27 +0200 Subject: [PATCH 31/31] Tex: Clean out unused TEXAI_MSG_UNIT_MOVED handling from texai_unit_info_recv() That's dead code. TEXAI_MSG_UNIT_MOVED is being handled in texai_unit_moved_recv(). See osdn #41698 Signed-off-by: Marko Lindqvist --- ai/tex/texaiworld.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/ai/tex/texaiworld.c b/ai/tex/texaiworld.c index 993536e97f..c36a9eb6be 100644 --- a/ai/tex/texaiworld.c +++ b/ai/tex/texaiworld.c @@ -296,16 +296,8 @@ void texai_unit_info_recv(void *data, enum texaimsgtype msgtype) idex_register_unit(&texai_world, punit); unit_list_prepend(ptile->units, punit); unit_list_prepend(plr_data->units, punit); - } else if (msgtype == TEXAI_MSG_UNIT_MOVED) { - struct tile *old_tile; - punit = idex_lookup_unit(&texai_world, info->id); - - old_tile = punit->tile; - if (old_tile != ptile) { - unit_list_remove(old_tile->units, punit); - unit_list_prepend(ptile->units, punit); - } + unit_tile_set(punit, ptile); } else { fc_assert(msgtype == TEXAI_MSG_UNIT_CHANGED); @@ -313,8 +305,6 @@ void texai_unit_info_recv(void *data, enum texaimsgtype msgtype) punit->utype = type; } - - unit_tile_set(punit, ptile); } /**********************************************************************//** -- 2.30.1