From 2aa62a35efd615fd5a57ff1593bd3d9e2a2906dc Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 19 Aug 2022 05:36:56 +0300 Subject: [PATCH 39/39] Fix editor crash when no resource is available for a tile If a tile somehow had resource assigned to it, despite the terrain having no natural resources, client in editor mode could crash. See osdn #45390 Signed-off-by: Marko Lindqvist --- client/editor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/editor.c b/client/editor.c index d486a6f5bb..b869885539 100644 --- a/client/editor.c +++ b/client/editor.c @@ -595,7 +595,7 @@ static void editor_grab_tool(const struct tile *ptile) ett = ETT_TERRAIN_SPECIAL; value = extra_index(special); } - } else if (tile_resource(ptile) != NULL) { + } else if (first_resource != NULL) { ett = ETT_TERRAIN_RESOURCE; value = extra_index(first_resource); -- 2.35.1