summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-01-07 17:50:20 +0000
committerfrosch <frosch@openttd.org>2009-01-07 17:50:20 +0000
commitaedc0c13021b72be9aa19435b8594ed1d15f981b (patch)
tree9f75258b731a5d94d6680a4e4b41af36514bbc93 /src/roadveh_cmd.cpp
parentcf1e926e371f91628a6048adc0d62f129a0d84ab (diff)
downloadopenttd-aedc0c13021b72be9aa19435b8594ed1d15f981b.tar.xz
(svn r14903) -Fix: First create all articulated parts of roadvehicles, then call callback 36 capacity, also call it for all articulated parts.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index b0d5407e0..e36ec61e8 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -274,10 +274,15 @@ CommandCost 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);
+ v->cargo_cap = rvi->capacity;
AddArticulatedParts(vl, VEH_ROAD);
+ /* Call callback 36s after the whole consist has been constructed */
+ for (Vehicle *u = v; u != NULL; u = u->Next()) {
+ u->cargo_cap = GetVehicleProperty(u, 0x0F, u->cargo_cap);
+ }
+
VehiclePositionChanged(v);
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);