(svn r18531) -Fix [FS#3384] (r18404): for articulated road vehicles only the first part was accounted for, so for extremely short fronts and lots after it the spreading did not work as it should.

This commit is contained in:
rubidium
2009-12-18 21:34:06 +00:00
parent 6f5425a062
commit 6f1982d151
3 changed files with 9 additions and 5 deletions

View File

@@ -169,6 +169,8 @@ void RoadVehUpdateCache(RoadVehicle *v)
v->InvalidateNewGRFCacheOfChain();
v->rcache.cached_total_length = 0;
for (RoadVehicle *u = v; u != NULL; u = u->Next()) {
/* Check the v->first cache. */
assert(u->First() == v);
@@ -178,6 +180,7 @@ void RoadVehUpdateCache(RoadVehicle *v)
/* Update the length of the vehicle. */
u->rcache.cached_veh_length = GetRoadVehLength(u);
v->rcache.cached_total_length += u->rcache.cached_veh_length;
/* Invalidate the vehicle colour map */
u->colourmap = PAL_NONE;