mirror of https://github.com/OpenTTD/OpenTTD
(svn r11431) -Codechange: [NewGRF] Add support for changing rail vehicle user-defined bit mask (prop 25) via callback 36
parent
f0915957d4
commit
f28723830f
|
@ -548,7 +548,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
|
||||||
|
|
||||||
cargo_classes |= GetCargo(u->cargo_type)->classes;
|
cargo_classes |= GetCargo(u->cargo_type)->classes;
|
||||||
common_cargos[u->cargo_type]++;
|
common_cargos[u->cargo_type]++;
|
||||||
if (v->type == VEH_TRAIN) user_def_data |= RailVehInfo(u->engine_type)->user_def_data;
|
if (v->type == VEH_TRAIN) user_def_data |= u->u.rail.user_def_data;
|
||||||
common_subtypes[u->cargo_subtype]++;
|
common_subtypes[u->cargo_subtype]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -236,6 +236,8 @@ 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)) {
|
||||||
|
|
|
@ -136,6 +136,7 @@ struct VehicleRail {
|
||||||
* bit 7 = disable powered wagons.
|
* bit 7 = disable powered wagons.
|
||||||
*/
|
*/
|
||||||
byte cached_vis_effect;
|
byte cached_vis_effect;
|
||||||
|
byte user_def_data;
|
||||||
|
|
||||||
/* NOSAVE: for wagon override - id of the first engine in train
|
/* NOSAVE: for wagon override - id of the first engine in train
|
||||||
* 0xffff == not in train */
|
* 0xffff == not in train */
|
||||||
|
|
Loading…
Reference in New Issue