(svn r1291) -Codechange: prepared subsidies and towns to become an uint16 (happens
authortruelight
Tue, 28 Dec 2004 17:40:15 +0000
changeset 820 9d311999f866
parent 819 02e9296ccdca
child 821 4af53631a47a
(svn r1291) -Codechange: prepared subsidies and towns to become an uint16 (happens
after savegame bump)
economy.c
economy.h
town.h
--- a/economy.c	Tue Dec 28 17:18:46 2004 +0000
+++ b/economy.c	Tue Dec 28 17:40:15 2004 +0000
@@ -845,7 +845,7 @@
 	return tp;
 }
 
-void DeleteSubsidyWithIndustry(byte index)
+void DeleteSubsidyWithIndustry(uint16 index)
 {
 	Subsidy *s;
 
@@ -858,7 +858,7 @@
 	}
 }
 
-void DeleteSubsidyWithStation(byte index)
+void DeleteSubsidyWithStation(uint16 index)
 {
 	Subsidy *s;
 	bool dirty = false;
@@ -1062,8 +1062,10 @@
 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()
 };
 
--- a/economy.h	Tue Dec 28 17:18:46 2004 +0000
+++ b/economy.h	Tue Dec 28 17:40:15 2004 +0000
@@ -18,8 +18,8 @@
 typedef struct Subsidy {
 	byte cargo_type;
 	byte age;
-	byte from;
-	byte to;
+	uint16 from;
+	uint16 to;
 } Subsidy;
 
 
@@ -68,8 +68,8 @@
 
 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);
--- a/town.h	Tue Dec 28 17:18:46 2004 +0000
+++ b/town.h	Tue Dec 28 17:40:15 2004 +0000
@@ -67,7 +67,7 @@
 	byte road_build_months;
 
 	// Index in town array
-	byte index;
+	uint16 index;
 
 	// NOSAVE: UpdateTownRadius updates this given the house count.
 	uint16 radius[5];