summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-05-12 07:05:34 +0000
committerpeter1138 <peter1138@openttd.org>2007-05-12 07:05:34 +0000
commit1d5135830aba0db784a955c16c9986a48e6bfd62 (patch)
treeaa8b73d935ad66bb61ddc8bd2026585301060743 /src/roadveh_cmd.cpp
parent5e00e688f859110cf8a9b9dd9d2d09f1314226bb (diff)
downloadopenttd-1d5135830aba0db784a955c16c9986a48e6bfd62.tar.xz
(svn r9828) -Codechange: [NewGRF] Add support for changing cargo capacity with callback 36. This is set on construction for ships and roadvehicles, and whenever carriages are attached for trains.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index d87688600..aff10c3f8 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -211,6 +211,8 @@ int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
v->vehicle_flags = 0;
if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SETBIT(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE);
+ v->cargo_cap = GetVehicleProperty(v, 0x0F, rvi->capacity);
+
VehiclePositionChanged(v);
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
@@ -1849,7 +1851,7 @@ int32 CmdRefitRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
* carry twice as much mail/goods as normal cargo, and four times as
* many passengers
*/
- capacity = rvi->capacity;
+ capacity = GetVehicleProperty(v, 0x0F, rvi->capacity);
switch (old_cid) {
case CT_PASSENGERS: break;
case CT_MAIL: