From e4ae5feeaab0a69cbdcbf65502d74a867b245251 Mon Sep 17 00:00:00 2001 From: Bruno Cabete Date: Mon, 22 Jun 2026 17:00:52 -0300 Subject: [PATCH] Fix issue #789: game crashes when clicking on a city on empire map it looks like a bug that only crashes depending on the build/platform/compiler/whatever, as it is a simple array out of bounds error. It crashes for some people and grabs random garbage from OOB to others --- src/window/empire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window/empire.c b/src/window/empire.c index 32a5ef6a2f..2fcf04056d 100644 --- a/src/window/empire.c +++ b/src/window/empire.c @@ -578,7 +578,7 @@ static int get_tooltip_resource(tooltip_context *c) } } item_offset += lang_text_get_width(47, 4, FONT_NORMAL_GREEN); - for (int r = RESOURCE_MIN; r <= RESOURCE_MAX; r++) { + for (int r = RESOURCE_MIN; r < RESOURCE_MAX; r++) { if (city->buys_resource[r]) { if (is_mouse_hit(c, x_offset + 110 + item_offset, y_offset + 33, 26)) { return r;