changeset 15031:9cc282ac8519 draft

(svn r19647) -Fix [FS#3768]: trains loaded above the original IDs didn't have a default railtypelabel assigned to them, causing them to be unavailable
author yexo <yexo@openttd.org>
date Sat, 17 Apr 2010 09:12:26 +0000
parents 13f366082b6b
children 144f91334a6f
files src/newgrf.cpp
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -404,6 +404,9 @@
 		size_t len = (Engine::GetPoolSize() - engine_pool_size) * sizeof(*_gted);
 		memset(_gted + engine_pool_size, 0, len);
 	}
+	if (type == VEH_TRAIN) {
+		_gted[e->index].railtypelabel = GetRailTypeInfo(e->u.rail.railtype)->label;
+	}
 
 	grfmsg(5, "Created new engine at index %d for GRFID %x, type %d, index %d", e->index, BSWAP32(file->grfid), type, internal_id);