Mercurial > hg > openttd
changeset 8172:465c2493606f draft
(svn r11735) -Fix [FS#1574]: Don't reset loading indicator IDs when only reloading NewGRFs.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Tue, 01 Jan 2008 15:06:37 +0000 |
parents | df1e18335376 |
children | 2fe829d9da15 |
files | src/openttd.cpp src/vehicle.cpp src/vehicle_base.h |
diffstat | 3 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1371,7 +1371,7 @@ InitializeLandscapeVariables(true); /* Update all vehicles */ - AfterLoadVehicles(); + AfterLoadVehicles(true); /* Update all waypoints */ if (CheckSavegameVersion(12)) FixOldWaypoints(); @@ -2284,7 +2284,7 @@ LoadStringWidthTable(); /* reload vehicles */ ResetVehiclePosHash(); - AfterLoadVehicles(); + AfterLoadVehicles(false); StartupEngines(); /* update station and waypoint graphics */ AfterLoadWaypoints();
--- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -212,7 +212,7 @@ } /** Called after load to update coordinates */ -void AfterLoadVehicles() +void AfterLoadVehicles(bool clear_te_id) { Vehicle *v; @@ -222,7 +222,7 @@ v->UpdateDeltaXY(v->direction); - v->fill_percent_te_id = INVALID_TE_ID; + if (clear_te_id) v->fill_percent_te_id = INVALID_TE_ID; v->first = NULL; if (v->type == VEH_TRAIN) v->u.rail.first_engine = INVALID_ENGINE; if (v->type == VEH_ROAD) v->u.road.first_engine = INVALID_ENGINE;
--- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -181,7 +181,7 @@ /* Some declarations of functions, so we can make them friendly */ struct SaveLoad; extern const SaveLoad *GetVehicleDescription(VehicleType vt); -extern void AfterLoadVehicles(); +extern void AfterLoadVehicles(bool clear_te_id); struct LoadgameState; extern bool LoadOldVehicle(LoadgameState *ls, int num); @@ -194,7 +194,7 @@ Vehicle *first; // NOSAVE: pointer to the first vehicle in the chain public: friend const SaveLoad *GetVehicleDescription(VehicleType vt); // So we can use private/protected variables in the saveload code - friend void AfterLoadVehicles(); // So we can set the previous and first pointers while loading + friend void AfterLoadVehicles(bool clear_te_id); // So we can set the previous and first pointers while loading friend bool LoadOldVehicle(LoadgameState *ls, int num); // So we can set the proper next pointer while loading Vehicle *depot_list; // NOSAVE: linked list to tell what vehicles entered a depot during the last tick. Used by autoreplace