summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-06-06 16:54:22 +0000
committersmatz <smatz@openttd.org>2009-06-06 16:54:22 +0000
commit0c10006907b7d149f91d277a0c28a79b40eaa4c0 (patch)
treedc8cb6a7a9315a10688af00187db94be8911acef /src/openttd.cpp
parentc90819ff6d8d49ac25aa9194bdf04e8dfd7149ea (diff)
downloadopenttd-0c10006907b7d149f91d277a0c28a79b40eaa4c0.tar.xz
(svn r16527) -Codechange: use static member functions instead of simple casts when converting Vehicle to specialised vehicle types. Includes safety check
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 3504bb76d..50efa4f8c 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1119,7 +1119,7 @@ void StateGameLoop()
switch (v->type) {
case VEH_ROAD: {
- RoadVehicle *rv = (RoadVehicle *)v;
+ RoadVehicle *rv = RoadVehicle::From(v);
RoadVehicleCache cache = rv->rcache;
RoadVehUpdateCache(rv);
@@ -1130,7 +1130,7 @@ void StateGameLoop()
case VEH_TRAIN: {
uint length = 0;
- Train *t = (Train *)v;
+ Train *t = Train::From(v);
for (Vehicle *u = t; u != NULL; u = u->Next()) length++;
TrainCache *wagons = MallocT<TrainCache>(length);
@@ -1151,7 +1151,7 @@ void StateGameLoop()
} break;
case VEH_AIRCRAFT: {
- Aircraft *a = (Aircraft *)v;
+ Aircraft *a = Aircraft::From(v);
AircraftCache cache = a->acache;
UpdateAircraftCache(a);