From a2778f4cfe6fa7c25772a1f3c4d25fc8280b2ef1 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 5 Oct 2023 16:30:40 +0300 Subject: [PATCH 50/50] Drop unused show_unit_orders() See osdn #48216 Signed-off-by: Marko Lindqvist --- client/mapview_common.c | 45 ----------------------------------------- client/mapview_common.h | 1 - 2 files changed, 46 deletions(-) diff --git a/client/mapview_common.c b/client/mapview_common.c index 36534a51d1..b227feae7e 100644 --- a/client/mapview_common.c +++ b/client/mapview_common.c @@ -2476,51 +2476,6 @@ void show_tile_labels(int canvas_base_x, int canvas_base_y, max_label_height = MAX(max_label_height, new_max_height); } -/************************************************************************//** - Draw the goto route for the unit. Return TRUE if anything is drawn. - - This duplicates drawing code that is run during the hover state. -****************************************************************************/ -bool show_unit_orders(struct unit *punit) -{ - if (punit && unit_has_orders(punit)) { - struct tile *ptile = unit_tile(punit); - int i; - - for (i = 0; i < punit->orders.length; i++) { - int idx = (punit->orders.index + i) % punit->orders.length; - struct unit_order *order; - - if (punit->orders.index + i >= punit->orders.length - && !punit->orders.repeat) { - break; - } - - if (ptile == NULL) { - /* This shouldn't happen unless the server gives us invalid - * data. */ - log_warn("Unit orders with illegal tile."); - break; - } - - order = &punit->orders.list[idx]; - - switch (order->order) { - case ORDER_MOVE: - draw_segment(ptile, order->dir); - ptile = mapstep(&(wld.map), ptile, order->dir); - break; - default: - /* TODO: Graphics for other orders. */ - break; - } - } - return TRUE; - } else { - return FALSE; - } -} - /************************************************************************//** Draw a goto line at the given location and direction. The line goes from the source tile to the adjacent tile in the given direction. diff --git a/client/mapview_common.h b/client/mapview_common.h index fcf8de4e7a..f3db59dfd7 100644 --- a/client/mapview_common.h +++ b/client/mapview_common.h @@ -314,7 +314,6 @@ void show_city_descriptions(int canvas_base_x, int canvas_base_y, int width_base, int height_base); void show_tile_labels(int canvas_base_x, int canvas_base_y, int width_base, int height_base); -bool show_unit_orders(struct unit *punit); void draw_segment(struct tile *ptile, enum direction8 dir) fc__attribute((nonnull (1))); -- 2.40.1