summaryrefslogtreecommitdiff
path: root/aircraft_cmd.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-06-09 07:03:53 +0000
committerpeter1138 <peter1138@openttd.org>2006-06-09 07:03:53 +0000
commit9b043436d82eab08ce05fb717b84f49a1ca3a0f4 (patch)
treebbc05f231ea2e6adea3e7eefd67c28471cbf456f /aircraft_cmd.c
parent1b48a2bd9d41bb1f52fec30aabd05c342e3f0b5b (diff)
downloadopenttd-9b043436d82eab08ce05fb717b84f49a1ca3a0f4.tar.xz
(svn r5187) - NewGRF: temporarily change a vehicle's cargo subtype when calling the refit capacity callback.
Diffstat (limited to 'aircraft_cmd.c')
-rw-r--r--aircraft_cmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/aircraft_cmd.c b/aircraft_cmd.c
index 9a3306c3d..28b7eecdc 100644
--- a/aircraft_cmd.c
+++ b/aircraft_cmd.c
@@ -564,12 +564,15 @@ int32 CmdRefitAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (HASBIT(EngInfo(v->engine_type)->callbackmask, CBM_REFIT_CAPACITY)) {
/* Back up the existing cargo type */
CargoID temp_cid = v->cargo_type;
+ byte temp_subtype = v->cargo_subtype;
v->cargo_type = new_cid;
+ v->cargo_subtype = new_subtype;
callback = GetVehicleCallback(CBID_VEHICLE_REFIT_CAPACITY, 0, 0, v->engine_type, v);
/* Restore the cargo type */
v->cargo_type = temp_cid;
+ v->cargo_subtype = temp_subtype;
}
if (callback == CALLBACK_FAILED) {