summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2005-09-26 20:32:13 +0000
committerpeter1138 <peter1138@openttd.org>2005-09-26 20:32:13 +0000
commit50f1a93664c09bff09c0c5e06d73f515ecf90733 (patch)
tree75fd53c6ce62843a2001fb823e09d00292983ec8
parentfbf06041ca6ae5a7429ba7342480fca25ab442ed (diff)
downloadopenttd-50f1a93664c09bff09c0c5e06d73f515ecf90733.tar.xz
(svn r2991) Reset vehicle images on game load. Allows savegames with NewGRFs saved prior to r2868 to load.
-rw-r--r--vehicle.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vehicle.c b/vehicle.c
index b80426a43..f3c4acade 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -187,6 +187,14 @@ void AfterLoadVehicles(void)
FOR_ALL_VEHICLES(v) {
v->first = NULL;
if (v->type != 0) {
+ switch (v->type) {
+ case VEH_Train: v->cur_image = GetTrainImage(v, v->direction); break;
+ case VEH_Road: v->cur_image = GetRoadVehImage(v, v->direction); break;
+ case VEH_Ship: v->cur_image = GetShipImage(v, v->direction); break;
+ case VEH_Aircraft: v->cur_image = GetAircraftImage(v, v->direction); break;
+ default: break;
+ }
+
v->left_coord = INVALID_COORD;
VehiclePositionChanged(v);