changeset 14432:6e1f30daf018 draft

(svn r18989) -Codechange: [NewGRF] Initialise rail type map with default rail types.
author peter1138 <peter1138@openttd.org>
date Wed, 03 Feb 2010 07:58:43 +0000
parents e778a635a908
children 4b436d838659
files src/newgrf.cpp
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -5802,6 +5802,13 @@
 		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);