summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-12-14 21:33:53 +0000
committerterkhen <terkhen@openttd.org>2010-12-14 21:33:53 +0000
commit48b7916458de4b2cdbc226a4a6ab078db4c77e73 (patch)
treec3a49ca7a91890042ca56765574bc40a54c15f96 /src/saveload
parenta93944e765776c6e9a2bd556457cd93748068da6 (diff)
downloadopenttd-48b7916458de4b2cdbc226a4a6ab078db4c77e73.tar.xz
(svn r21521) -Codechange: Unify some cached values that were present in both road vehicles and trains.
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/vehicle_sl.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index c081ba2bc..f6e40e792 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -251,8 +251,7 @@ void AfterLoadVehicles(bool part_of_load)
if (part_of_load) v->fill_percent_te_id = INVALID_TE_ID;
v->first = NULL;
- if (v->type == VEH_TRAIN) Train::From(v)->tcache.first_engine = INVALID_ENGINE;
- if (v->type == VEH_ROAD) RoadVehicle::From(v)->rcache.first_engine = INVALID_ENGINE;
+ if (v->IsGroundVehicle()) v->GetGroundVehicleCache()->first_engine = INVALID_ENGINE;
}
/* AfterLoadVehicles may also be called in case of NewGRF reload, in this