From 38e446f19d6f38084b99ab98afc1002e2b107855 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 6 Jan 2023 18:08:01 +0200 Subject: [PATCH 40/40] tileset_setup_unit_direction(): Fix gcc-9 warning See osdn #46465 Signed-off-by: Marko Lindqvist --- client/tilespec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/tilespec.c b/client/tilespec.c index b870476cdd..daba362197 100644 --- a/client/tilespec.c +++ b/client/tilespec.c @@ -3582,6 +3582,12 @@ static bool tileset_setup_unit_direction(struct tileset *t, { enum direction8 loaddir = dir; char buf[2048]; + const char *act_name = unit_activity_name(activity); + + if (act_name == NULL) { + /* gcc-9 thinks this is possible. */ + return NULL; + } /* * There may be more orientations available in this tileset than are @@ -3603,8 +3609,7 @@ static bool tileset_setup_unit_direction(struct tileset *t, } fc_snprintf(buf, sizeof(buf), "%s_%s_%s", base_str, - unit_activity_name(activity), - dir_get_tileset_name(loaddir)); + act_name, dir_get_tileset_name(loaddir)); /* We don't use _alt graphics here, as that could lead to loading * real icon gfx, but alternative orientation gfx. Tileset author -- 2.39.0