summaryrefslogtreecommitdiff
path: root/newgrf_engine.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-05-17 08:20:36 +0000
committerpeter1138 <peter1138@openttd.org>2006-05-17 08:20:36 +0000
commit5a65e3301ef6698f42332cc5275af58fcd47460f (patch)
tree86473fe61b5bbbf5466a59213c097725714ee861 /newgrf_engine.c
parentafd69f53f59b5bf1e4c51b56434931e62f186180 (diff)
downloadopenttd-5a65e3301ef6698f42332cc5275af58fcd47460f.tar.xz
(svn r4896) - NewGRF: add support for vehicle property 0x25 (user defined data) used by variable 0x42.
Diffstat (limited to 'newgrf_engine.c')
-rw-r--r--newgrf_engine.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/newgrf_engine.c b/newgrf_engine.c
index 46af6e888..c89dbd0a7 100644
--- a/newgrf_engine.c
+++ b/newgrf_engine.c
@@ -534,6 +534,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
byte cargo_classes = 0;
uint common_cargo_best = 0;
uint common_cargos[NUM_GLOBAL_CID];
+ byte user_def_data = 0;
CargoID cargo;
CargoID common_cargo_type = GC_PASSENGERS;
@@ -547,6 +548,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
cargo = _global_cargo_id[_opt.landscape][u->cargo_type];
cargo_classes |= _cargo_classes[cargo];
common_cargos[cargo]++;
+ user_def_data |= RailVehInfo(u->engine_type)->user_def_data;
}
/* Pick the most common cargo type */
@@ -557,7 +559,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
}
}
- return cargo_classes | (common_cargo_type << 8);
+ return cargo_classes | (common_cargo_type << 8) | (user_def_data << 24);
}
case 0x43: /* Player information */