summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-04-17 09:12:26 +0000
committeryexo <yexo@openttd.org>2010-04-17 09:12:26 +0000
commit7a3b6f158879728e051a390696cf716163111e8d (patch)
tree392c2482a9d094bb3c41be42b8d6512137b40731
parent6bed2196773bb57d2d62c3fc985fa66744f2f901 (diff)
downloadopenttd-7a3b6f158879728e051a390696cf716163111e8d.tar.xz
(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
-rw-r--r--src/newgrf.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index c5af46506..854c1ca66 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -404,6 +404,9 @@ static Engine *GetNewEngine(const GRFFile *file, VehicleType type, uint16 intern
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);