From 2e61040da04767ee351f3e4ff1864328e6422175 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Wed, 10 Feb 2021 10:17:04 +0100 Subject: [PATCH] action_auto_perf_unit_do(): extra can be NULL. See osdn #41538 --- server/actiontools.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/actiontools.c b/server/actiontools.c index 223fe445f4..15a455e31a 100644 --- a/server/actiontools.c +++ b/server/actiontools.c @@ -1025,15 +1025,16 @@ action_auto_perf_unit_do(const enum action_auto_perf_cause cause, if (tgt_tile && is_action_enabled_unit_on_tile(act, actor, tgt_tile, target_extra)) { - perform_action_to(act, actor, tgt_tile->index, extra_number(target_extra)); + perform_action_to(act, actor, tgt_tile->index, + target_extra ? extra_number(target_extra) : -1); } break; case ATK_EXTRAS: if (tgt_tile && is_action_enabled_unit_on_extras(act, actor, tgt_tile, target_extra)) { - perform_action_to(act, actor, - tgt_tile->index, extra_number(target_extra)); + perform_action_to(act, actor, tgt_tile->index, + target_extra ? extra_number(target_extra) : -1); } break; case ATK_CITY: -- 2.20.1