summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-03-17 21:49:14 +0000
committerglx <glx@openttd.org>2008-03-17 21:49:14 +0000
commite2ec1e703272ee05650e897d47e79315f5bc2bca (patch)
tree05478fcb9d8fa0a7fbd5e9add7263c2764059f22 /src
parenta6cba39750916393aed65f8d5421517b4125c836 (diff)
downloadopenttd-e2ec1e703272ee05650e897d47e79315f5bc2bca.tar.xz
(svn r12377) -Fix [FS#1854]: set cached value for vehicle property 25 before other cached values
Diffstat (limited to 'src')
-rw-r--r--src/train_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 4246f0c9e..c89e1271b 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -214,6 +214,9 @@ void TrainConsistChanged(Vehicle* v)
/* Reset color map */
u->colormap = PAL_NONE;
+ /* Set user defined data (must be done before other properties) */
+ u->u.rail.user_def_data = GetVehicleProperty(u, 0x25, rvi_u->user_def_data);
+
if (rvi_u->visual_effect != 0) {
u->u.rail.cached_vis_effect = rvi_u->visual_effect;
} else {
@@ -270,8 +273,6 @@ void TrainConsistChanged(Vehicle* v)
u->cargo_cap = GetVehicleProperty(u, 0x14, rvi_u->capacity);
}
- u->u.rail.user_def_data = GetVehicleProperty(u, 0x25, rvi_u->user_def_data);
-
/* check the vehicle length (callback) */
uint16 veh_len = CALLBACK_FAILED;
if (HasBit(EngInfo(u->engine_type)->callbackmask, CBM_VEHICLE_LENGTH)) {