summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2010-02-03 07:58:43 +0000
committerpeter1138 <peter1138@openttd.org>2010-02-03 07:58:43 +0000
commit9950fc1edefbbf8744648a9fecd0d951b30b728d (patch)
tree39df24e20a2383b1ae4e68ed21b5c58a47fae583 /src
parent39c1de23d611d287d38afc88c42bb4b4a864d20f (diff)
downloadopenttd-9950fc1edefbbf8744648a9fecd0d951b30b728d.tar.xz
(svn r18989) -Codechange: [NewGRF] Initialise rail type map with default rail types.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index d16b034bc..ef8ec93ac 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -5802,6 +5802,13 @@ static void InitNewGRFFile(const GRFConfig *config, int sprite_offset)
newfile->price_base_multipliers[i] = INVALID_PRICE_MODIFIER;
}
+ /* Initialise rail type map with default rail types */
+ memset(newfile->railtype_map, INVALID_RAILTYPE, sizeof newfile->railtype_map);
+ newfile->railtype_map[0] = RAILTYPE_RAIL;
+ newfile->railtype_map[1] = RAILTYPE_ELECTRIC;
+ newfile->railtype_map[2] = RAILTYPE_MONO;
+ newfile->railtype_map[3] = RAILTYPE_MAGLEV;
+
/* Copy the initial parameter list
* 'Uninitialised' parameters are zeroed as that is their default value when dynamically creating them. */
assert_compile(lengthof(newfile->param) == lengthof(config->param) && lengthof(config->param) == 0x80);