summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-20 12:22:38 +0000
committerrubidium <rubidium@openttd.org>2011-01-20 12:22:38 +0000
commit2f6c840ebf94c9c0386abcb0217540a1c2a7ae85 (patch)
treebe5ded654afdcffe47d25a8d2cb6dd87531eb196 /src/rail_cmd.cpp
parent6a2ae9281159ad17a64f88d871561382ce366697 (diff)
downloadopenttd-2f6c840ebf94c9c0386abcb0217540a1c2a7ae85.tar.xz
(svn r21866) -Feature [FS#4394]: [NewGRF] Rail type property to influence sorting of rail types in the drop down list
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r--src/rail_cmd.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 508ba8459..824deaedd 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -106,6 +106,14 @@ RailType AllocateRailType(RailTypeLabel label)
/* We also introduce ourself. */
rti->introduces_railtypes = (RailTypes)(1 << rt);
+
+ /* Default sort order; order of allocation, but with some
+ * offsets so it's easier for NewGRF to pick a spot without
+ * changing the order of other (original) rail types.
+ * The << is so you can place other railtypes in between the
+ * other railtypes, the 7 is to be able to place something
+ * before the first (default) rail type. */
+ rti->sorting_order = rt << 4 | 7;
return rt;
}
}