(svn r16393) -Codechange: move VehicleRail to Train.

This commit is contained in:
rubidium
2009-05-22 22:55:41 +00:00
parent c4b627af42
commit da5661a0c8
18 changed files with 136 additions and 136 deletions

View File

@@ -247,8 +247,8 @@ public:
const Vehicle *v = Yapf().GetVehicle();
assert(v != NULL);
assert(v->type == VEH_TRAIN);
assert(v->u.rail.cached_total_length != 0);
int missing_platform_length = (v->u.rail.cached_total_length + TILE_SIZE - 1) / TILE_SIZE - platform_length;
assert(((Train *)v)->tcache.cached_total_length != 0);
int missing_platform_length = (((Train *)v)->tcache.cached_total_length + TILE_SIZE - 1) / TILE_SIZE - platform_length;
if (missing_platform_length < 0) {
/* apply penalty for longer platform than needed */
cost += Yapf().PfGetSettings().rail_longer_platform_penalty + Yapf().PfGetSettings().rail_longer_platform_per_tile_penalty * -missing_platform_length;