(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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user