From 4e6c440877b6f1a6f9ef3e917f070ea049358385 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 9 Oct 2022 14:39:37 +0300 Subject: [PATCH 25/25] Fix dead assignment of 'oaction' in execute_orders() See osdn #45812 Signed-off-by: Marko Lindqvist --- server/unittools.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/unittools.c b/server/unittools.c index 5001d1c468..54abdb18e1 100644 --- a/server/unittools.c +++ b/server/unittools.c @@ -4136,9 +4136,6 @@ bool execute_orders(struct unit *punit, const bool fresh) while (TRUE) { struct unit_order order; - - struct action *oaction; - struct tile *dst_tile; struct city *tgt_city; struct unit *tgt_unit; @@ -4367,12 +4364,16 @@ bool execute_orders(struct unit *punit, const bool fresh) } break; case ORDER_PERFORM_ACTION: - oaction = action_by_number(order.action); + { +#if !defined(FREECIV_NDEBUG) || defined(FREECIV_DEBUG) + struct action *oaction = action_by_number(order.action); +#endif /* !FREECIV_NDEBUG || FREECIV_DEBUG */ - /* Checked in unit_order_list_is_sane() */ - fc_assert_action(oaction != NULL, continue); + /* Checked in unit_order_list_is_sane() */ + fc_assert_action(oaction != NULL, continue); - log_debug(" orders: doing action %s", action_rule_name(oaction)); + log_debug(" orders: doing action %s", action_rule_name(oaction)); + } if (!direction8_is_valid(order.dir)) { /* The target of the action is on the actor's tile. */ -- 2.35.1