(svn r21521) -Codechange: Unify some cached values that were present in both road vehicles and trains.

This commit is contained in:
terkhen
2010-12-14 21:33:53 +00:00
parent cfa00ad14b
commit f69d280f14
18 changed files with 69 additions and 113 deletions

View File

@@ -1370,7 +1370,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
if (v->type == VEH_TRAIN) {
/* Each platform tile is worth 2 rail vehicles. */
int overhang = Train::From(v)->tcache.cached_total_length - st->GetPlatformLength(v->tile) * TILE_SIZE;
int overhang = v->GetGroundVehicleCache()->cached_total_length - st->GetPlatformLength(v->tile) * TILE_SIZE;
if (overhang > 0) {
unloading_time <<= 1;
unloading_time += (overhang * unloading_time) / 8;