1
0
Fork 0

(svn r1291) -Codechange: prepared subsidies and towns to become an uint16 (happens

after savegame bump)
release/0.4.5
truelight 2004-12-28 17:40:15 +00:00
parent c4d073a4de
commit e6a59be8c0
3 changed files with 11 additions and 9 deletions

View File

@ -845,7 +845,7 @@ Pair SetupSubsidyDecodeParam(Subsidy *s, bool mode)
return tp; return tp;
} }
void DeleteSubsidyWithIndustry(byte index) void DeleteSubsidyWithIndustry(uint16 index)
{ {
Subsidy *s; Subsidy *s;
@ -858,7 +858,7 @@ void DeleteSubsidyWithIndustry(byte index)
} }
} }
void DeleteSubsidyWithStation(byte index) void DeleteSubsidyWithStation(uint16 index)
{ {
Subsidy *s; Subsidy *s;
bool dirty = false; bool dirty = false;
@ -1062,8 +1062,10 @@ no_add:;
static const byte _subsidies_desc[] = { static const byte _subsidies_desc[] = {
SLE_VAR(Subsidy,cargo_type, SLE_UINT8), SLE_VAR(Subsidy,cargo_type, SLE_UINT8),
SLE_VAR(Subsidy,age, SLE_UINT8), SLE_VAR(Subsidy,age, SLE_UINT8),
SLE_VAR(Subsidy,from, SLE_UINT8), SLE_CONDVAR(Subsidy,from, SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
SLE_VAR(Subsidy,to, SLE_UINT8), SLE_CONDVAR(Subsidy,from, SLE_UINT16, 5, 255),
SLE_CONDVAR(Subsidy,to, SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
SLE_CONDVAR(Subsidy,to, SLE_UINT16, 5, 255),
SLE_END() SLE_END()
}; };

View File

@ -18,8 +18,8 @@ VARDEF Economy _economy;
typedef struct Subsidy { typedef struct Subsidy {
byte cargo_type; byte cargo_type;
byte age; byte age;
byte from; uint16 from;
byte to; uint16 to;
} Subsidy; } Subsidy;
@ -68,8 +68,8 @@ void UpdatePlayerHouse(Player *p, uint score);
VARDEF Subsidy _subsidies[MAX_PLAYERS]; VARDEF Subsidy _subsidies[MAX_PLAYERS];
Pair SetupSubsidyDecodeParam(Subsidy *s, bool mode); Pair SetupSubsidyDecodeParam(Subsidy *s, bool mode);
void DeleteSubsidyWithIndustry(byte index); void DeleteSubsidyWithIndustry(uint16 index);
void DeleteSubsidyWithStation(byte index); void DeleteSubsidyWithStation(uint16 index);
void RemoteSubsidyAdd(Subsidy *s_new); void RemoteSubsidyAdd(Subsidy *s_new);
int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, byte cargo_type); int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, byte cargo_type);

2
town.h
View File

@ -67,7 +67,7 @@ struct Town {
byte road_build_months; byte road_build_months;
// Index in town array // Index in town array
byte index; uint16 index;
// NOSAVE: UpdateTownRadius updates this given the house count. // NOSAVE: UpdateTownRadius updates this given the house count.
uint16 radius[5]; uint16 radius[5];