(svn r8709) -Fix/Codechange: Rename the function GetStationPlatforms into GetPlatformLength because that is what it really does. Overload it because there is already a GetPlatformLength (one gives the length of the whole platform, the other gives the remaining length in a given direction). Turned both functions into methods of Station. While messing around with it, fix a problem where loading times for overhanging trains are miscomputed.

This commit is contained in:
celestar
2007-02-13 16:36:38 +00:00
parent 5e880a6a75
commit d9385f2798
6 changed files with 55 additions and 56 deletions

View File

@@ -1519,7 +1519,7 @@ int LoadUnloadVehicle(Vehicle *v, bool just_arrived)
if (v->type == VEH_Train) {
// Each platform tile is worth 2 rail vehicles.
int overhang = v->u.rail.cached_total_length - GetStationPlatforms(st, v->tile) * TILE_SIZE;
int overhang = v->u.rail.cached_total_length - st->GetPlatformLength(v->tile) * TILE_SIZE;
if (overhang > 0) {
unloading_time <<= 1;
unloading_time += (overhang * unloading_time) / 8;