summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2007-02-13 16:36:38 +0000
committercelestar <celestar@openttd.org>2007-02-13 16:36:38 +0000
commitd9385f27986a59fa6b4a557e9bd6a04dc80752d8 (patch)
tree95900e955779b893062a6fbfbae3fa7fcf8323d1 /src/economy.cpp
parent5e880a6a75d5fb3e9d9b90d30ebd720c9dce2a6e (diff)
downloadopenttd-d9385f27986a59fa6b4a557e9bd6a04dc80752d8.tar.xz
(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.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index b97e8df55..8ac68e8b9 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -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;