mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r12377) -Fix [FS#1854]: set cached value for vehicle property 25 before other cached values
This commit is contained in:
parent
a6cba39750
commit
e2ec1e7032
@ -214,6 +214,9 @@ void TrainConsistChanged(Vehicle* v)
|
|||||||
/* Reset color map */
|
/* Reset color map */
|
||||||
u->colormap = PAL_NONE;
|
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) {
|
if (rvi_u->visual_effect != 0) {
|
||||||
u->u.rail.cached_vis_effect = rvi_u->visual_effect;
|
u->u.rail.cached_vis_effect = rvi_u->visual_effect;
|
||||||
} else {
|
} else {
|
||||||
@ -270,8 +273,6 @@ void TrainConsistChanged(Vehicle* v)
|
|||||||
u->cargo_cap = GetVehicleProperty(u, 0x14, rvi_u->capacity);
|
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) */
|
/* check the vehicle length (callback) */
|
||||||
uint16 veh_len = CALLBACK_FAILED;
|
uint16 veh_len = CALLBACK_FAILED;
|
||||||
if (HasBit(EngInfo(u->engine_type)->callbackmask, CBM_VEHICLE_LENGTH)) {
|
if (HasBit(EngInfo(u->engine_type)->callbackmask, CBM_VEHICLE_LENGTH)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user