summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-10-03 14:46:48 +0000
committerfrosch <frosch@openttd.org>2009-10-03 14:46:48 +0000
commit12a814f487883b291c17bba69a5cd41ebf862708 (patch)
tree66839262ba2a509a285ffbf30c4888307fd1b937 /src/train_cmd.cpp
parent539f31f76c73c5c2e10a3f47664184d867416be8 (diff)
downloadopenttd-12a814f487883b291c17bba69a5cd41ebf862708.tar.xz
(svn r17684) -Fix: tcache.first_engine and rcache.first_engine need to be set before first callback/sprite-resolving. For RV fronts it was missing at all, causing livery selection to fail.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 684a789b3..acad557a6 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -720,6 +720,7 @@ static CommandCost CmdBuildRailWagon(EngineID engine, TileIndex tile, DoCommandF
v->spritenum = rvi->image_index;
v->engine_type = engine;
+ v->tcache.first_engine = INVALID_ENGINE; // needs to be set before first callback
DiagDirection dir = GetRailDepotDirection(tile);
@@ -900,6 +901,7 @@ CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1,
// v->dest_tile = 0;
v->engine_type = p1;
+ v->tcache.first_engine = INVALID_ENGINE; // needs to be set before first callback
v->reliability = e->reliability;
v->reliability_spd_dec = e->reliability_spd_dec;