Skip to content

Commit e4ae5fe

Browse files
authored
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
1 parent 016d525 commit e4ae5fe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/window/empire.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ static int get_tooltip_resource(tooltip_context *c)
578578
}
579579
}
580580
item_offset += lang_text_get_width(47, 4, FONT_NORMAL_GREEN);
581-
for (int r = RESOURCE_MIN; r <= RESOURCE_MAX; r++) {
581+
for (int r = RESOURCE_MIN; r < RESOURCE_MAX; r++) {
582582
if (city->buys_resource[r]) {
583583
if (is_mouse_hit(c, x_offset + 110 + item_offset, y_offset + 33, 26)) {
584584
return r;

0 commit comments

Comments
 (0)