diff options
author | rubidium <rubidium@openttd.org> | 2009-05-22 22:55:41 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-05-22 22:55:41 +0000 |
commit | da5661a0c8870c532c393ec3d330c3fbb44eb8ac (patch) | |
tree | 93b9332d7e83e012a46777e2baf91bf323ea9fe9 /src/economy.cpp | |
parent | c4b627af422075ce4a0e1026c52f871dd3f146c0 (diff) | |
download | openttd-da5661a0c8870c532c393ec3d330c3fbb44eb8ac.tar.xz |
(svn r16393) -Codechange: move VehicleRail to Train.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r-- | src/economy.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index e940c1e0c..0f90b8bdc 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -15,6 +15,7 @@ #include "vehicle_gui.h" #include "ai/ai.hpp" #include "aircraft.h" +#include "train.h" #include "newgrf_engine.h" #include "newgrf_sound.h" #include "newgrf_industries.h" @@ -1650,7 +1651,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left) /* update stats */ int t; switch (u->type) { - case VEH_TRAIN: t = u->u.rail.cached_max_speed; break; + case VEH_TRAIN: t = ((Train *)u)->tcache.cached_max_speed; break; case VEH_ROAD: t = u->max_speed / 2; break; default: t = u->max_speed; break; } @@ -1759,7 +1760,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left) if (v->type == VEH_TRAIN) { /* Each platform tile is worth 2 rail vehicles. */ - int overhang = v->u.rail.cached_total_length - st->GetPlatformLength(v->tile) * TILE_SIZE; + int overhang = ((Train *)v)->tcache.cached_total_length - st->GetPlatformLength(v->tile) * TILE_SIZE; if (overhang > 0) { unloading_time <<= 1; unloading_time += (overhang * unloading_time) / 8; |