summaryrefslogtreecommitdiff
path: root/src/articulated_vehicles.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/articulated_vehicles.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/articulated_vehicles.cpp')
-rw-r--r--src/articulated_vehicles.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/articulated_vehicles.cpp b/src/articulated_vehicles.cpp
index f1ce4dc56..04d86aa2a 100644
--- a/src/articulated_vehicles.cpp
+++ b/src/articulated_vehicles.cpp
@@ -318,7 +318,7 @@ void AddArticulatedParts(Vehicle *first, VehicleType type)
t->subtype = 0;
t->track = front->track;
t->railtype = front->railtype;
- t->tcache.first_engine = front->engine_type;
+ t->tcache.first_engine = front->engine_type; // needs to be set before first callback
t->spritenum = e_artic->u.rail.image_index;
if (e_artic->CanCarryCargo()) {
@@ -339,7 +339,7 @@ void AddArticulatedParts(Vehicle *first, VehicleType type)
v = rv;
rv->subtype = 0;
- rv->rcache.first_engine = front->engine_type;
+ rv->rcache.first_engine = front->engine_type; // needs to be set before first callback
rv->rcache.cached_veh_length = 8; // Callback is called when the consist is finished
rv->state = RVSB_IN_DEPOT;