summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/industry_gui.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 6be98e280..7a45c1192 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -1410,7 +1410,9 @@ protected:
GetString(buf_cache, STR_INDUSTRY_NAME, lastof(buf_cache));
}
- return strnatcmp(buf, buf_cache) < 0; // Sort by name (natural sorting).
+ int r = strnatcmp(buf, buf_cache); // Sort by name (natural sorting).
+ if (r == 0) return a->index < b->index;
+ return r < 0;
}
/** Sort industries by type and name */