summaryrefslogtreecommitdiff
path: root/src/company_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-10-30 17:24:30 +0000
committerfrosch <frosch@openttd.org>2015-10-30 17:24:30 +0000
commit2d636266f59e8f5e88c3460b9adb8889442108d8 (patch)
tree2ce70a31ab745556593c46cb72d5c2341b34cc69 /src/company_gui.cpp
parent312809228d52009191e2000cc1a49272b48f9699 (diff)
downloadopenttd-2d636266f59e8f5e88c3460b9adb8889442108d8.tar.xz
(svn r27427) -Fix: Use the NewGRF railtype sorting order in the infrastructure window.
Diffstat (limited to 'src/company_gui.cpp')
-rw-r--r--src/company_gui.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 1343acb91..0be667958 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -1764,7 +1764,8 @@ struct CompanyInfrastructureWindow : Window
if (this->railtypes != RAILTYPES_NONE) {
/* Draw name of each valid railtype. */
- for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
+ RailType rt;
+ FOR_ALL_SORTED_RAILTYPES(rt) {
if (HasBit(this->railtypes, rt)) {
SetDParam(0, GetRailTypeInfo(rt)->strings.name);
DrawString(r.left + offs_left, r.right - offs_right, y += FONT_HEIGHT_NORMAL, STR_WHITE_STRING);
@@ -1781,7 +1782,8 @@ struct CompanyInfrastructureWindow : Window
case WID_CI_RAIL_COUNT: {
/* Draw infrastructure count for each valid railtype. */
uint32 rail_total = c->infrastructure.GetRailTotal();
- for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
+ RailType rt;
+ FOR_ALL_SORTED_RAILTYPES(rt) {
if (HasBit(this->railtypes, rt)) {
this->DrawCountLine(r, y, c->infrastructure.rail[rt], RailMaintenanceCost(rt, c->infrastructure.rail[rt], rail_total));
}