summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-10-20 20:01:56 +0000
committerfrosch <frosch@openttd.org>2009-10-20 20:01:56 +0000
commitffb729ac9e891c63bcc60b04a3662d3ae8942179 (patch)
treed3d4470d979a57c4158b8a967159b1b4f2d6ec53
parent8df61c0fc0b36ea07391171b8a14908fdea0dd1a (diff)
downloadopenttd-ffb729ac9e891c63bcc60b04a3662d3ae8942179.tar.xz
(svn r17827) -Codechange: Deduplicate some lines of code.
-rw-r--r--src/roadveh_cmd.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 1a63c06e4..b092b4c60 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -278,19 +278,17 @@ CommandCost CmdBuildRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
v->vehicle_flags = 0;
if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SetBit(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE);
- v->cargo_cap = rvi->capacity;
-
AddArticulatedParts(v);
v->InvalidateNewGRFCacheOfChain();
/* Call various callbacks after the whole consist has been constructed */
for (RoadVehicle *u = v; u != NULL; u = u->Next()) {
- u->rcache.cached_veh_length = GetRoadVehLength(u);
/* Cargo capacity is zero if and only if the vehicle cannot carry anything */
if (u->cargo_cap != 0) u->cargo_cap = GetVehicleProperty(u, PROP_ROADVEH_CARGO_CAPACITY, u->cargo_cap);
v->InvalidateNewGRFCache();
u->InvalidateNewGRFCache();
}
+ RoadVehUpdateCache(v);
VehicleMove(v, false);