(svn r25259) -Codechange: track capacities and usage of links

This commit is contained in:
rubidium
2013-05-19 14:22:04 +00:00
parent 6515371cf5
commit 6b746167e4
18 changed files with 447 additions and 14 deletions

View File

@@ -1252,6 +1252,7 @@ bool LoadOldVehicle(LoadgameState *ls, int num)
if (!LoadChunk(ls, v, vehicle_chunk)) return false;
if (v == NULL) continue;
v->refit_cap = v->cargo_cap;
SpriteID sprite = v->cur_image;
/* no need to override other sprites */

View File

@@ -246,6 +246,7 @@
* 179 24810
* 180 24998 1.3.x
* 181 25012
* 182 25259
*/
extern const uint16 SAVEGAME_VERSION = 181; ///< Current savegame version of OpenTTD.

View File

@@ -604,6 +604,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt)
SLE_VAR(Vehicle, vehstatus, SLE_UINT8),
SLE_CONDVAR(Vehicle, last_station_visited, SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
SLE_CONDVAR(Vehicle, last_station_visited, SLE_UINT16, 5, SL_MAX_VERSION),
SLE_CONDVAR(Vehicle, last_loading_station, SLE_UINT16, 182, SL_MAX_VERSION),
SLE_VAR(Vehicle, cargo_type, SLE_UINT8),
SLE_CONDVAR(Vehicle, cargo_subtype, SLE_UINT8, 35, SL_MAX_VERSION),
@@ -612,6 +613,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt)
SLEG_CONDVAR( _cargo_source, SLE_UINT16, 7, 67),
SLEG_CONDVAR( _cargo_source_xy, SLE_UINT32, 44, 67),
SLE_VAR(Vehicle, cargo_cap, SLE_UINT16),
SLE_CONDVAR(Vehicle, refit_cap, SLE_UINT16, 182, SL_MAX_VERSION),
SLEG_CONDVAR( _cargo_count, SLE_UINT16, 0, 67),
SLE_CONDLST(Vehicle, cargo.packets, REF_CARGO_PACKET, 68, SL_MAX_VERSION),
SLE_CONDARR(Vehicle, cargo.action_counts, SLE_UINT, VehicleCargoList::NUM_MOVE_TO_ACTION, 181, SL_MAX_VERSION),
@@ -903,6 +905,8 @@ void Load_VEHS()
v->last_station_visited = INVALID_STATION;
}
if (IsSavegameVersionBefore(182)) v->last_loading_station = INVALID_STATION;
if (IsSavegameVersionBefore(5)) {
/* Convert the current_order.type (which is a mix of type and flags, because
* in those versions, they both were 4 bits big) to type and flags */