summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-28 17:40:15 +0000
committertruelight <truelight@openttd.org>2004-12-28 17:40:15 +0000
commit3e1a12299c10444335c332d492c1e048ef79a281 (patch)
treefa334ac69546d4d32a85202264818ed9fd45b3f5
parentbd580437b83b63c0c100948ab6ec82a73fe1d88f (diff)
downloadopenttd-3e1a12299c10444335c332d492c1e048ef79a281.tar.xz
(svn r1291) -Codechange: prepared subsidies and towns to become an uint16 (happens
after savegame bump)
-rw-r--r--economy.c10
-rw-r--r--economy.h8
-rw-r--r--town.h2
3 files changed, 11 insertions, 9 deletions
diff --git a/economy.c b/economy.c
index 87bfcb551..04bd4d7c1 100644
--- a/economy.c
+++ b/economy.c
@@ -845,7 +845,7 @@ Pair SetupSubsidyDecodeParam(Subsidy *s, bool mode)
return tp;
}
-void DeleteSubsidyWithIndustry(byte index)
+void DeleteSubsidyWithIndustry(uint16 index)
{
Subsidy *s;
@@ -858,7 +858,7 @@ void DeleteSubsidyWithIndustry(byte index)
}
}
-void DeleteSubsidyWithStation(byte index)
+void DeleteSubsidyWithStation(uint16 index)
{
Subsidy *s;
bool dirty = false;
@@ -1062,8 +1062,10 @@ no_add:;
static const byte _subsidies_desc[] = {
SLE_VAR(Subsidy,cargo_type, SLE_UINT8),
SLE_VAR(Subsidy,age, SLE_UINT8),
- SLE_VAR(Subsidy,from, SLE_UINT8),
- SLE_VAR(Subsidy,to, 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,to, SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
+ SLE_CONDVAR(Subsidy,to, SLE_UINT16, 5, 255),
SLE_END()
};
diff --git a/economy.h b/economy.h
index 36ac2247e..9ca38b1b9 100644
--- a/economy.h
+++ b/economy.h
@@ -18,8 +18,8 @@ VARDEF Economy _economy;
typedef struct Subsidy {
byte cargo_type;
byte age;
- byte from;
- byte to;
+ uint16 from;
+ uint16 to;
} Subsidy;
@@ -68,8 +68,8 @@ void UpdatePlayerHouse(Player *p, uint score);
VARDEF Subsidy _subsidies[MAX_PLAYERS];
Pair SetupSubsidyDecodeParam(Subsidy *s, bool mode);
-void DeleteSubsidyWithIndustry(byte index);
-void DeleteSubsidyWithStation(byte index);
+void DeleteSubsidyWithIndustry(uint16 index);
+void DeleteSubsidyWithStation(uint16 index);
void RemoteSubsidyAdd(Subsidy *s_new);
int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, byte cargo_type);
diff --git a/town.h b/town.h
index 3fca8d9f4..54d9acde7 100644
--- a/town.h
+++ b/town.h
@@ -67,7 +67,7 @@ struct Town {
byte road_build_months;
// Index in town array
- byte index;
+ uint16 index;
// NOSAVE: UpdateTownRadius updates this given the house count.
uint16 radius[5];