summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-11-06 13:03:17 +0000
committerterkhen <terkhen@openttd.org>2010-11-06 13:03:17 +0000
commit25d1b2f54b9cac01e2737848c208f6d8096a4a92 (patch)
tree37860a84857248e929612d7ed018a4e2065d31cd /src/economy.cpp
parentc8a56f17f82be7d4a8e935fc514c86a313dc7d15 (diff)
downloadopenttd-25d1b2f54b9cac01e2737848c208f6d8096a4a92.tar.xz
(svn r21098) -Codechange: Ships now store their max speed in the cache instead of recalculating it every time.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index f7326f4e2..ecccc99a1 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1228,9 +1228,11 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
/* update stats */
int t;
switch (u->type) {
- case VEH_TRAIN: t = u->vcache.cached_max_speed; break;
+ case VEH_TRAIN: /* FALL THROUGH */
+ case VEH_SHIP:
+ t = u->vcache.cached_max_speed;
+ break;
case VEH_ROAD: t = u->max_speed / 2; break;
- case VEH_SHIP: t = u->max_speed; break;
case VEH_AIRCRAFT: t = Aircraft::From(u)->GetSpeedOldUnits(); break; // Convert to old units.
default: NOT_REACHED();
}