diff options
author | Darkvater <darkvater@openttd.org> | 2006-02-20 19:43:26 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-02-20 19:43:26 +0000 |
commit | 45e85d2eb2f3c0989bdcb746be2460a60d235273 (patch) | |
tree | ed77a71f5446c2a70d26f0045fb2341b38b84ebf | |
parent | fa337ae64a554ae77fed3dfb1147acc7890e77ca (diff) | |
download | openttd-45e85d2eb2f3c0989bdcb746be2460a60d235273.tar.xz |
(svn r3627) - Change all hardcoded 255 max-saveload versions with the define SL_MAX_VERSION
-rw-r--r-- | depot.c | 2 | ||||
-rw-r--r-- | economy.c | 4 | ||||
-rw-r--r-- | engine.c | 2 | ||||
-rw-r--r-- | industry_cmd.c | 4 | ||||
-rw-r--r-- | order_cmd.c | 2 | ||||
-rw-r--r-- | players.c | 48 | ||||
-rw-r--r-- | signs.c | 6 | ||||
-rw-r--r-- | station_cmd.c | 28 | ||||
-rw-r--r-- | town_cmd.c | 24 | ||||
-rw-r--r-- | vehicle.c | 64 | ||||
-rw-r--r-- | waypoint.c | 12 |
11 files changed, 98 insertions, 98 deletions
@@ -108,7 +108,7 @@ void InitializeDepot(void) static const SaveLoad _depot_desc[] = { SLE_CONDVAR(Depot, xy, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Depot, xy, SLE_UINT32, 6, 255), + SLE_CONDVAR(Depot, xy, SLE_UINT32, 6, SL_MAX_VERSION), SLE_VAR(Depot,town_index, SLE_UINT16), SLE_END() }; @@ -1075,9 +1075,9 @@ static const SaveLoad _subsidies_desc[] = { SLE_VAR(Subsidy,cargo_type, SLE_UINT8), SLE_VAR(Subsidy,age, SLE_UINT8), SLE_CONDVAR(Subsidy,from, SLE_FILE_U8 | SLE_VAR_U16, 0, 4), - SLE_CONDVAR(Subsidy,from, SLE_UINT16, 5, 255), + SLE_CONDVAR(Subsidy,from, SLE_UINT16, 5, SL_MAX_VERSION), SLE_CONDVAR(Subsidy,to, SLE_FILE_U8 | SLE_VAR_U16, 0, 4), - SLE_CONDVAR(Subsidy,to, SLE_UINT16, 5, 255), + SLE_CONDVAR(Subsidy,to, SLE_UINT16, 5, SL_MAX_VERSION), SLE_END() }; @@ -681,7 +681,7 @@ static const SaveLoad _engine_desc[] = { SLE_VAR(Engine,player_avail, SLE_UINT8), // reserve extra space in savegame here. (currently 16 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, SL_MAX_VERSION), SLE_END() }; diff --git a/industry_cmd.c b/industry_cmd.c index 7aee70407..81941b1cd 100644 --- a/industry_cmd.c +++ b/industry_cmd.c @@ -1905,7 +1905,7 @@ const TileTypeProcs _tile_type_industry_procs = { static const SaveLoad _industry_desc[] = { SLE_CONDVAR(Industry, xy, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Industry, xy, SLE_UINT32, 6, 255), + SLE_CONDVAR(Industry, xy, SLE_UINT32, 6, SL_MAX_VERSION), SLE_VAR(Industry,width, SLE_UINT8), SLE_VAR(Industry,height, SLE_UINT8), SLE_REF(Industry,town, REF_TOWN), @@ -1929,7 +1929,7 @@ static const SaveLoad _industry_desc[] = { SLE_VAR(Industry,was_cargo_delivered,SLE_UINT8), // reserve extra space in savegame here. (currently 32 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 4, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 4, 2, SL_MAX_VERSION), SLE_END() }; diff --git a/order_cmd.c b/order_cmd.c index 07433dce7..662acbacd 100644 --- a/order_cmd.c +++ b/order_cmd.c @@ -1100,7 +1100,7 @@ static const SaveLoad _order_desc[] = { SLE_REF(Order,next, REF_ORDER), // reserve extra space in savegame here. (currently 10 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 10, 5, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 10, 5, SL_MAX_VERSION), SLE_END() }; @@ -1117,7 +1117,7 @@ static const SaveLoad _player_desc[] = { // money was changed to a 64 bit field in savegame version 1. SLE_CONDVAR(Player,money64, SLE_VAR_I64 | SLE_FILE_I32, 0, 0), - SLE_CONDVAR(Player,money64, SLE_INT64, 1, 255), + SLE_CONDVAR(Player,money64, SLE_INT64, 1, SL_MAX_VERSION), SLE_VAR(Player,current_loan, SLE_INT32), @@ -1128,9 +1128,9 @@ static const SaveLoad _player_desc[] = { SLE_VAR(Player,cargo_types, SLE_UINT16), SLE_CONDVAR(Player, location_of_house, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Player, location_of_house, SLE_UINT32, 6, 255), + SLE_CONDVAR(Player, location_of_house, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Player, last_build_coordinate, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Player, last_build_coordinate, SLE_UINT32, 6, 255), + SLE_CONDVAR(Player, last_build_coordinate, SLE_UINT32, 6, SL_MAX_VERSION), SLE_VAR(Player,inaugurated_year,SLE_UINT8), SLE_ARR(Player,share_owners, SLE_UINT8, 4), @@ -1144,22 +1144,22 @@ static const SaveLoad _player_desc[] = { // yearly expenses was changed to 64-bit in savegame version 2. SLE_CONDARR(Player,yearly_expenses, SLE_FILE_I32|SLE_VAR_I64, 3*13, 0, 1), - SLE_CONDARR(Player,yearly_expenses, SLE_INT64, 3*13, 2, 255), + SLE_CONDARR(Player,yearly_expenses, SLE_INT64, 3*13, 2, SL_MAX_VERSION), - SLE_CONDVAR(Player,is_ai, SLE_UINT8, 2, 255), - SLE_CONDVAR(Player,is_active, SLE_UINT8, 4, 255), + SLE_CONDVAR(Player,is_ai, SLE_UINT8, 2, SL_MAX_VERSION), + SLE_CONDVAR(Player,is_active, SLE_UINT8, 4, SL_MAX_VERSION), // Engine renewal settings SLE_CONDARR(NullStruct,null,SLE_FILE_U16 | SLE_VAR_NULL, 256, 16, 18), - SLE_CONDREF(Player,engine_renew_list, REF_ENGINE_RENEWS, 19, 255), - SLE_CONDVAR(Player,engine_renew, SLE_UINT8, 16, 255), - SLE_CONDVAR(Player,engine_renew_months, SLE_INT16, 16, 255), - SLE_CONDVAR(Player,engine_renew_money, SLE_UINT32, 16, 255), - SLE_CONDVAR(Player,renew_keep_length, SLE_UINT8, 2, 255), // added with 16.1, but was blank since 2 + SLE_CONDREF(Player,engine_renew_list, REF_ENGINE_RENEWS, 19, SL_MAX_VERSION), + SLE_CONDVAR(Player,engine_renew, SLE_UINT8, 16, SL_MAX_VERSION), + SLE_CONDVAR(Player,engine_renew_months, SLE_INT16, 16, SL_MAX_VERSION), + SLE_CONDVAR(Player,engine_renew_money, SLE_UINT32, 16, SL_MAX_VERSION), + SLE_CONDVAR(Player,renew_keep_length, SLE_UINT8, 2, SL_MAX_VERSION), // added with 16.1, but was blank since 2 // reserve extra space in savegame here. (currently 63 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 7, 2, 255), - SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 7, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 7, 2, SL_MAX_VERSION), + SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 7, 2, SL_MAX_VERSION), SLE_END() }; @@ -1169,9 +1169,9 @@ static const SaveLoad _player_economy_desc[] = { SLE_CONDVAR(PlayerEconomyEntry,income, SLE_INT32, 0, 1), SLE_CONDVAR(PlayerEconomyEntry,expenses, SLE_INT32, 0, 1), SLE_CONDVAR(PlayerEconomyEntry,company_value, SLE_FILE_I32 | SLE_VAR_I64, 0, 1), - SLE_CONDVAR(PlayerEconomyEntry,income, SLE_FILE_I64 | SLE_VAR_I32, 2, 255), - SLE_CONDVAR(PlayerEconomyEntry,expenses,SLE_FILE_I64 | SLE_VAR_I32, 2, 255), - SLE_CONDVAR(PlayerEconomyEntry,company_value, SLE_INT64, 2, 255), + SLE_CONDVAR(PlayerEconomyEntry,income, SLE_FILE_I64 | SLE_VAR_I32, 2, SL_MAX_VERSION), + SLE_CONDVAR(PlayerEconomyEntry,expenses,SLE_FILE_I64 | SLE_VAR_I32, 2, SL_MAX_VERSION), + SLE_CONDVAR(PlayerEconomyEntry,company_value, SLE_INT64, 2, SL_MAX_VERSION), SLE_VAR(PlayerEconomyEntry,delivered_cargo, SLE_INT32), SLE_VAR(PlayerEconomyEntry,performance_history, SLE_INT32), @@ -1183,7 +1183,7 @@ static const SaveLoad _player_ai_desc[] = { SLE_VAR(PlayerAI,state, SLE_UINT8), SLE_VAR(PlayerAI,tick, SLE_UINT8), SLE_CONDVAR(PlayerAI,state_counter, SLE_FILE_U16 | SLE_VAR_U32, 0, 12), - SLE_CONDVAR(PlayerAI,state_counter, SLE_UINT32, 13, 255), + SLE_CONDVAR(PlayerAI,state_counter, SLE_UINT32, 13, SL_MAX_VERSION), SLE_VAR(PlayerAI,timeout_counter, SLE_UINT16), SLE_VAR(PlayerAI,state_mode, SLE_UINT8), @@ -1200,16 +1200,16 @@ static const SaveLoad _player_ai_desc[] = { SLE_VAR(PlayerAI,route_type_mask, SLE_UINT8), SLE_CONDVAR(PlayerAI, start_tile_a, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(PlayerAI, start_tile_a, SLE_UINT32, 6, 255), + SLE_CONDVAR(PlayerAI, start_tile_a, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(PlayerAI, cur_tile_a, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(PlayerAI, cur_tile_a, SLE_UINT32, 6, 255), + SLE_CONDVAR(PlayerAI, cur_tile_a, SLE_UINT32, 6, SL_MAX_VERSION), SLE_VAR(PlayerAI,start_dir_a, SLE_UINT8), SLE_VAR(PlayerAI,cur_dir_a, SLE_UINT8), SLE_CONDVAR(PlayerAI, start_tile_b, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(PlayerAI, start_tile_b, SLE_UINT32, 6, 255), + SLE_CONDVAR(PlayerAI, start_tile_b, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(PlayerAI, cur_tile_b, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(PlayerAI, cur_tile_b, SLE_UINT32, 6, 255), + SLE_CONDVAR(PlayerAI, cur_tile_b, SLE_UINT32, 6, SL_MAX_VERSION), SLE_VAR(PlayerAI,start_dir_b, SLE_UINT8), SLE_VAR(PlayerAI,cur_dir_b, SLE_UINT8), @@ -1219,15 +1219,15 @@ static const SaveLoad _player_ai_desc[] = { SLE_ARR(PlayerAI,order_list_blocks, SLE_UINT8, 20), SLE_ARR(PlayerAI,banned_tiles, SLE_UINT16, 16), - SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 8, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 8, 2, SL_MAX_VERSION), SLE_END() }; static const SaveLoad _player_ai_build_rec_desc[] = { SLE_CONDVAR(AiBuildRec,spec_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(AiBuildRec,spec_tile, SLE_UINT32, 6, 255), + SLE_CONDVAR(AiBuildRec,spec_tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(AiBuildRec,use_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(AiBuildRec,use_tile, SLE_UINT32, 6, 255), + SLE_CONDVAR(AiBuildRec,use_tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_VAR(AiBuildRec,rand_rng, SLE_UINT8), SLE_VAR(AiBuildRec,cur_building_rule,SLE_UINT8), SLE_VAR(AiBuildRec,unk6, SLE_UINT8), @@ -226,9 +226,9 @@ static const SaveLoad _sign_desc[] = { SLE_VAR(SignStruct,str, SLE_UINT16), SLE_CONDVAR(SignStruct,x, SLE_FILE_I16 | SLE_VAR_I32, 0, 4), SLE_CONDVAR(SignStruct,y, SLE_FILE_I16 | SLE_VAR_I32, 0, 4), - SLE_CONDVAR(SignStruct,x, SLE_INT32, 5, 255), - SLE_CONDVAR(SignStruct,y, SLE_INT32, 5, 255), - SLE_CONDVAR(SignStruct,owner, SLE_UINT8, 6, 255), + SLE_CONDVAR(SignStruct,x, SLE_INT32, 5, SL_MAX_VERSION), + SLE_CONDVAR(SignStruct,y, SLE_INT32, 5, SL_MAX_VERSION), + SLE_CONDVAR(SignStruct,owner, SLE_UINT8, 6, SL_MAX_VERSION), SLE_VAR(SignStruct,z, SLE_UINT8), SLE_END() }; diff --git a/station_cmd.c b/station_cmd.c index 025835f69..dc441c38a 100644 --- a/station_cmd.c +++ b/station_cmd.c @@ -2828,18 +2828,18 @@ static const SaveLoad _roadstop_desc[] = { static const SaveLoad _station_desc[] = { SLE_CONDVAR(Station, xy, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Station, xy, SLE_UINT32, 6, 255), + SLE_CONDVAR(Station, xy, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Station, bus_tile_obsolete, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), SLE_CONDVAR(Station, lorry_tile_obsolete, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), SLE_CONDVAR(Station, train_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Station, train_tile, SLE_UINT32, 6, 255), + SLE_CONDVAR(Station, train_tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Station, airport_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Station, airport_tile, SLE_UINT32, 6, 255), + SLE_CONDVAR(Station, airport_tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Station, dock_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Station, dock_tile, SLE_UINT32, 6, 255), + SLE_CONDVAR(Station, dock_tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_REF(Station,town, REF_TOWN), SLE_VAR(Station,trainst_w, SLE_UINT8), - SLE_CONDVAR(Station,trainst_h, SLE_UINT8, 2, 255), + SLE_CONDVAR(Station,trainst_h, SLE_UINT8, 2, SL_MAX_VERSION), // alpha_order was stored here in savegame format 0 - 3 SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 1, 0, 3), @@ -2862,19 +2862,19 @@ static const SaveLoad _station_desc[] = { SLE_CONDVAR(Station,blocked_months_obsolete, SLE_UINT8, 0, 4), SLE_CONDVAR(Station,airport_flags, SLE_VAR_U32 | SLE_FILE_U16, 0, 2), - SLE_CONDVAR(Station,airport_flags, SLE_UINT32, 3, 255), + SLE_CONDVAR(Station,airport_flags, SLE_UINT32, 3, SL_MAX_VERSION), SLE_VAR(Station,last_vehicle, SLE_UINT16), - SLE_CONDVAR(Station,class_id, SLE_UINT8, 3, 255), - SLE_CONDVAR(Station,stat_id, SLE_UINT8, 3, 255), - SLE_CONDVAR(Station,build_date, SLE_UINT16, 3, 255), + SLE_CONDVAR(Station,class_id, SLE_UINT8, 3, SL_MAX_VERSION), + SLE_CONDVAR(Station,stat_id, SLE_UINT8, 3, SL_MAX_VERSION), + SLE_CONDVAR(Station,build_date, SLE_UINT16, 3, SL_MAX_VERSION), - SLE_CONDREF(Station,bus_stops, REF_ROADSTOPS, 6, 255), - SLE_CONDREF(Station,truck_stops, REF_ROADSTOPS, 6, 255), + SLE_CONDREF(Station,bus_stops, REF_ROADSTOPS, 6, SL_MAX_VERSION), + SLE_CONDREF(Station,truck_stops, REF_ROADSTOPS, 6, SL_MAX_VERSION), // reserve extra space in savegame here. (currently 28 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 32, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 32, 2, SL_MAX_VERSION), SLE_END() }; @@ -2884,11 +2884,11 @@ static const SaveLoad _goods_desc[] = { SLE_VAR(GoodsEntry,days_since_pickup, SLE_UINT8), SLE_VAR(GoodsEntry,rating, SLE_UINT8), SLE_CONDVAR(GoodsEntry,enroute_from, SLE_FILE_U8 | SLE_VAR_U16, 0, 6), - SLE_CONDVAR(GoodsEntry,enroute_from, SLE_UINT16, 7, 255), + SLE_CONDVAR(GoodsEntry,enroute_from, SLE_UINT16, 7, SL_MAX_VERSION), SLE_VAR(GoodsEntry,enroute_time, SLE_UINT8), SLE_VAR(GoodsEntry,last_speed, SLE_UINT8), SLE_VAR(GoodsEntry,last_age, SLE_UINT8), - SLE_CONDVAR(GoodsEntry,feeder_profit, SLE_INT32, 14, 255), + SLE_CONDVAR(GoodsEntry,feeder_profit, SLE_INT32, 14, SL_MAX_VERSION), SLE_END() }; diff --git a/town_cmd.c b/town_cmd.c index 492cb07a2..a5684a58f 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -1962,10 +1962,10 @@ const TileTypeProcs _tile_type_town_procs = { // Save and load of towns. static const SaveLoad _town_desc[] = { SLE_CONDVAR(Town, xy, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Town, xy, SLE_UINT32, 6, 255), + SLE_CONDVAR(Town, xy, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Town,population, SLE_FILE_U16 | SLE_VAR_U32, 0, 2), - SLE_CONDVAR(Town,population, SLE_UINT32, 3, 255), + SLE_CONDVAR(Town,population, SLE_UINT32, 3, SL_MAX_VERSION), SLE_VAR(Town,num_houses, SLE_UINT16), @@ -1981,7 +1981,7 @@ static const SaveLoad _town_desc[] = { SLE_VAR(Town,have_ratings,SLE_UINT8), SLE_ARR(Town,ratings, SLE_INT16, 8), // failed bribe attempts are stored since savegame format 4 - SLE_CONDARR(Town,unwanted, SLE_INT8, 8, 4,255), + SLE_CONDARR(Town,unwanted, SLE_INT8, 8, 4,SL_MAX_VERSION), SLE_CONDVAR(Town,max_pass, SLE_FILE_U16 | SLE_VAR_U32, 0, 8), SLE_CONDVAR(Town,max_mail, SLE_FILE_U16 | SLE_VAR_U32, 0, 8), @@ -1992,14 +1992,14 @@ static const SaveLoad _town_desc[] = { SLE_CONDVAR(Town,new_act_pass,SLE_FILE_U16 | SLE_VAR_U32, 0, 8), SLE_CONDVAR(Town,new_act_mail,SLE_FILE_U16 | SLE_VAR_U32, 0, 8), - SLE_CONDVAR(Town,max_pass, SLE_UINT32, 9, 255), - SLE_CONDVAR(Town,max_mail, SLE_UINT32, 9, 255), - SLE_CONDVAR(Town,new_max_pass,SLE_UINT32, 9, 255), - SLE_CONDVAR(Town,new_max_mail,SLE_UINT32, 9, 255), - SLE_CONDVAR(Town,act_pass, SLE_UINT32, 9, 255), - SLE_CONDVAR(Town,act_mail, SLE_UINT32, 9, 255), - SLE_CONDVAR(Town,new_act_pass,SLE_UINT32, 9, 255), - SLE_CONDVAR(Town,new_act_mail,SLE_UINT32, 9, 255), + SLE_CONDVAR(Town,max_pass, SLE_UINT32, 9, SL_MAX_VERSION), + SLE_CONDVAR(Town,max_mail, SLE_UINT32, 9, SL_MAX_VERSION), + SLE_CONDVAR(Town,new_max_pass,SLE_UINT32, 9, SL_MAX_VERSION), + SLE_CONDVAR(Town,new_max_mail,SLE_UINT32, 9, SL_MAX_VERSION), + SLE_CONDVAR(Town,act_pass, SLE_UINT32, 9, SL_MAX_VERSION), + SLE_CONDVAR(Town,act_mail, SLE_UINT32, 9, SL_MAX_VERSION), + SLE_CONDVAR(Town,new_act_pass,SLE_UINT32, 9, SL_MAX_VERSION), + SLE_CONDVAR(Town,new_act_mail,SLE_UINT32, 9, SL_MAX_VERSION), SLE_VAR(Town,pct_pass_transported,SLE_UINT8), SLE_VAR(Town,pct_mail_transported,SLE_UINT8), @@ -2018,7 +2018,7 @@ static const SaveLoad _town_desc[] = { SLE_VAR(Town,exclusivity, SLE_UINT8), SLE_VAR(Town,exclusive_counter, SLE_UINT8), // reserve extra space in savegame here. (currently 30 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 30, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 30, 2, SL_MAX_VERSION), SLE_END() }; @@ -2053,17 +2053,17 @@ const SaveLoad _common_veh_desc[] = { SLE_REF(Vehicle,next, REF_VEHICLE_OLD), SLE_VAR(Vehicle,string_id, SLE_STRINGID), SLE_CONDVAR(Vehicle,unitnumber, SLE_FILE_U8 | SLE_VAR_U16, 0, 7), - SLE_CONDVAR(Vehicle,unitnumber, SLE_UINT16, 8, 255), + SLE_CONDVAR(Vehicle,unitnumber, SLE_UINT16, 8, SL_MAX_VERSION), SLE_VAR(Vehicle,owner, SLE_UINT8), SLE_CONDVAR(Vehicle,tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Vehicle,tile, SLE_UINT32, 6, 255), + SLE_CONDVAR(Vehicle,tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Vehicle,dest_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Vehicle,dest_tile, SLE_UINT32, 6, 255), + SLE_CONDVAR(Vehicle,dest_tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Vehicle,x_pos, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Vehicle,x_pos, SLE_UINT32, 6, 255), + SLE_CONDVAR(Vehicle,x_pos, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Vehicle,y_pos, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Vehicle,y_pos, SLE_UINT32, 6, 255), + SLE_CONDVAR(Vehicle,y_pos, SLE_UINT32, 6, SL_MAX_VERSION), SLE_VAR(Vehicle,z_pos, SLE_UINT8), SLE_VAR(Vehicle,direction, SLE_UINT8), @@ -2084,12 +2084,12 @@ const SaveLoad _common_veh_desc[] = { 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, 255), + SLE_CONDVAR(Vehicle,last_station_visited, SLE_UINT16, 5, SL_MAX_VERSION), SLE_VAR(Vehicle,cargo_type, SLE_UINT8), SLE_VAR(Vehicle,cargo_days, SLE_UINT8), SLE_CONDVAR(Vehicle,cargo_source, SLE_FILE_U8 | SLE_VAR_U16, 0, 6), - SLE_CONDVAR(Vehicle,cargo_source, SLE_UINT16, 7, 255), + SLE_CONDVAR(Vehicle,cargo_source, SLE_UINT16, 7, SL_MAX_VERSION), SLE_VAR(Vehicle,cargo_cap, SLE_UINT16), SLE_VAR(Vehicle,cargo_count, SLE_UINT16), @@ -2106,9 +2106,9 @@ const SaveLoad _common_veh_desc[] = { SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_FILE_U8 | SLE_VAR_U16, 0, 4), /* Orders for version 5 and on */ - SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, type), SLE_UINT8, 5, 255), - SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, flags), SLE_UINT8, 5, 255), - SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_UINT16, 5, 255), + SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, type), SLE_UINT8, 5, SL_MAX_VERSION), + SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, flags), SLE_UINT8, 5, SL_MAX_VERSION), + SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_UINT16, 5, SL_MAX_VERSION), SLE_REF(Vehicle,orders, REF_ORDER), @@ -2137,7 +2137,7 @@ const SaveLoad _common_veh_desc[] = { SLE_REF(Vehicle,prev_shared, REF_VEHICLE), // reserve extra space in savegame here. (currently 10 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 10, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 10, 2, SL_MAX_VERSION), SLE_END() }; @@ -2151,12 +2151,12 @@ static const SaveLoad _train_desc[] = { SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRail,railtype), SLE_UINT8), SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRail,track), SLE_UINT8), - SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,flags), SLE_UINT8, 2, 255), - SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,days_since_order_progr), SLE_UINT16, 2, 255), + SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,flags), SLE_UINT8, 2, SL_MAX_VERSION), + SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,days_since_order_progr), SLE_UINT16, 2, SL_MAX_VERSION), SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL, 2, 2, 19), // reserve extra space in savegame here. (currently 11 bytes) - SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL, 11, 2, 255), + SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL, 11, 2, SL_MAX_VERSION), SLE_END() }; @@ -2172,11 +2172,11 @@ static const SaveLoad _roadveh_desc[] = { SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,crashed_ctr), SLE_UINT16), SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,reverse_ctr), SLE_UINT8), - SLE_CONDREFX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slot), REF_ROADSTOPS, 6, 255), - SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slotindex), SLE_UINT8, 6, 255), - SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slot_age), SLE_UINT8, 6, 255), + SLE_CONDREFX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slot), REF_ROADSTOPS, 6, SL_MAX_VERSION), + SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slotindex), SLE_UINT8, 6, SL_MAX_VERSION), + SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slot_age), SLE_UINT8, 6, SL_MAX_VERSION), // reserve extra space in savegame here. (currently 16 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, SL_MAX_VERSION), SLE_END() }; @@ -2187,7 +2187,7 @@ static const SaveLoad _ship_desc[] = { SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleShip,state), SLE_UINT8), // reserve extra space in savegame here. (currently 16 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, SL_MAX_VERSION), SLE_END() }; @@ -2199,14 +2199,14 @@ static const SaveLoad _aircraft_desc[] = { SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleAir,pos), SLE_UINT8), SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleAir,targetairport), SLE_FILE_U8 | SLE_VAR_U16, 0, 4), - SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleAir,targetairport), SLE_UINT16, 5, 255), + SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleAir,targetairport), SLE_UINT16, 5, SL_MAX_VERSION), SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleAir,state), SLE_UINT8), - SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleAir,previous_pos), SLE_UINT8, 2, 255), + SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleAir,previous_pos), SLE_UINT8, 2, SL_MAX_VERSION), // reserve extra space in savegame here. (currently 15 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 15, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 15, 2, SL_MAX_VERSION), SLE_END() }; @@ -2217,12 +2217,12 @@ static const SaveLoad _special_desc[] = { SLE_VAR(Vehicle,subtype, SLE_UINT8), SLE_CONDVAR(Vehicle,tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Vehicle,tile, SLE_UINT32, 6, 255), + SLE_CONDVAR(Vehicle,tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Vehicle,x_pos, SLE_FILE_I16 | SLE_VAR_I32, 0, 5), - SLE_CONDVAR(Vehicle,x_pos, SLE_INT32, 6, 255), + SLE_CONDVAR(Vehicle,x_pos, SLE_INT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Vehicle,y_pos, SLE_FILE_I16 | SLE_VAR_I32, 0, 5), - SLE_CONDVAR(Vehicle,y_pos, SLE_INT32, 6, 255), + SLE_CONDVAR(Vehicle,y_pos, SLE_INT32, 6, SL_MAX_VERSION), SLE_VAR(Vehicle,z_pos, SLE_UINT8), SLE_VAR(Vehicle,cur_image, SLE_UINT16), @@ -2238,7 +2238,7 @@ static const SaveLoad _special_desc[] = { SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleSpecial,unk2), SLE_UINT8), // reserve extra space in savegame here. (currently 16 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, SL_MAX_VERSION), SLE_END() }; @@ -2250,14 +2250,14 @@ static const SaveLoad _disaster_desc[] = { SLE_VAR(Vehicle,subtype, SLE_UINT8), SLE_CONDVAR(Vehicle,tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Vehicle,tile, SLE_UINT32, 6, 255), + SLE_CONDVAR(Vehicle,tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Vehicle,dest_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Vehicle,dest_tile, SLE_UINT32, 6, 255), + SLE_CONDVAR(Vehicle,dest_tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Vehicle,x_pos, SLE_FILE_I16 | SLE_VAR_I32, 0, 5), - SLE_CONDVAR(Vehicle,x_pos, SLE_INT32, 6, 255), + SLE_CONDVAR(Vehicle,x_pos, SLE_INT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Vehicle,y_pos, SLE_FILE_I16 | SLE_VAR_I32, 0, 5), - SLE_CONDVAR(Vehicle,y_pos, SLE_INT32, 6, 255), + SLE_CONDVAR(Vehicle,y_pos, SLE_INT32, 6, SL_MAX_VERSION), SLE_VAR(Vehicle,z_pos, SLE_UINT8), SLE_VAR(Vehicle,direction, SLE_UINT8), @@ -2269,7 +2269,7 @@ static const SaveLoad _disaster_desc[] = { SLE_VAR(Vehicle,owner, SLE_UINT8), SLE_VAR(Vehicle,vehstatus, SLE_UINT8), SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_FILE_U8 | SLE_VAR_U16, 0, 4), - SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_UINT16, 5, 255), + SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_UINT16, 5, SL_MAX_VERSION), SLE_VAR(Vehicle,cur_image, SLE_UINT16), SLE_VAR(Vehicle,age, SLE_UINT16), @@ -2280,7 +2280,7 @@ static const SaveLoad _disaster_desc[] = { SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleDisaster,unk2), SLE_UINT16), // reserve extra space in savegame here. (currently 16 bytes) - SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, 255), + SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, SL_MAX_VERSION), SLE_END() }; diff --git a/waypoint.c b/waypoint.c index 36af86cf4..d3eff1603 100644 --- a/waypoint.c +++ b/waypoint.c @@ -449,15 +449,15 @@ void InitializeWaypoints(void) static const SaveLoad _waypoint_desc[] = { SLE_CONDVAR(Waypoint, xy, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Waypoint, xy, SLE_UINT32, 6, 255), - SLE_CONDVAR(Waypoint, town_index, SLE_UINT16, 12, 255), - SLE_CONDVAR(Waypoint, town_cn, SLE_UINT8, 12, 255), + SLE_CONDVAR(Waypoint, xy, SLE_UINT32, 6, SL_MAX_VERSION), + SLE_CONDVAR(Waypoint, town_index, SLE_UINT16, 12, SL_MAX_VERSION), + SLE_CONDVAR(Waypoint, town_cn, SLE_UINT8, 12, SL_MAX_VERSION), SLE_VAR(Waypoint, string, SLE_UINT16), SLE_VAR(Waypoint, deleted, SLE_UINT8), - SLE_CONDVAR(Waypoint, build_date, SLE_UINT16, 3, 255), - SLE_CONDVAR(Waypoint, localidx, SLE_UINT8, 3, 255), - SLE_CONDVAR(Waypoint, grfid, SLE_UINT32, 17, 255), + SLE_CONDVAR(Waypoint, build_date, SLE_UINT16, 3, SL_MAX_VERSION), + SLE_CONDVAR(Waypoint, localidx, SLE_UINT8, 3, SL_MAX_VERSION), + SLE_CONDVAR(Waypoint, grfid, SLE_UINT32, 17, SL_MAX_VERSION), SLE_END() }; |