summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2009-02-11 18:10:12 +0000
committerpeter1138 <peter1138@openttd.org>2009-02-11 18:10:12 +0000
commit519277f980be4f0e666995b831ed8a35ad1df271 (patch)
tree56d2170e33551e95fafa6011e0b81eb6edd5867a /src
parenteeaa4c8d9a9d110bbb39ea284aeffd5acdb90a16 (diff)
downloadopenttd-519277f980be4f0e666995b831ed8a35ad1df271.tar.xz
(svn r15448) -Codechange: Don't show rail types in selection drop downs if they have no label.
Diffstat (limited to 'src')
-rw-r--r--src/autoreplace_gui.cpp3
-rw-r--r--src/toolbar_gui.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 4c6ace490..ba60f74c3 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -347,7 +347,8 @@ public:
DropDownList *list = new DropDownList();
for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
const RailtypeInfo *rti = GetRailTypeInfo(rt);
-
+ /* Skip rail type if it has no label */
+ if (rti->label == 0) continue;
list->push_back(new DropDownListStringItem(rti->strings.replace_text, rt, !HasBit(c->avail_railtypes, rt)));
}
ShowDropDownList(this, list, sel_railtype, RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN);
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index a70a79128..5b6793208 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -628,6 +628,8 @@ static void ToolbarBuildRailClick(Window *w)
DropDownList *list = new DropDownList();
for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
const RailtypeInfo *rti = GetRailTypeInfo(rt);
+ /* Skip rail type if it has no label */
+ if (rti->label == 0) continue;
list->push_back(new DropDownListStringItem(rti->strings.menu_text, rt, !HasBit(c->avail_railtypes, rt)));
}
ShowDropDownList(w, list, _last_built_railtype, TBN_RAILS, 140, true, true);