summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-03-26 22:41:56 +0000
committerDarkvater <darkvater@openttd.org>2006-03-26 22:41:56 +0000
commit2ba792d64447968bbd18c755a6e4d1720728c5ae (patch)
tree9bd460410009e4e5c945bf15b225b476092a0fe6
parentfa86dff4c3f02a8dbdc339b421a7096d10bae368 (diff)
downloadopenttd-2ba792d64447968bbd18c755a6e4d1720728c5ae.tar.xz
(svn r4130) - CodeChange: Add proper semantics for TownID for such variables instead of using the general uint16-type. We probably need to change GetTown() and IsTownIndex() as well to use TownID.
-rw-r--r--depot.h2
-rw-r--r--economy.h1
-rw-r--r--openttd.h1
-rw-r--r--town.h6
-rw-r--r--waypoint.h2
5 files changed, 7 insertions, 5 deletions
diff --git a/depot.h b/depot.h
index 1cc87e316..3ab106881 100644
--- a/depot.h
+++ b/depot.h
@@ -15,7 +15,7 @@
struct Depot {
TileIndex xy;
- uint16 town_index;
+ TownID town_index;
uint16 index;
};
diff --git a/economy.h b/economy.h
index 72d259697..1167c6860 100644
--- a/economy.h
+++ b/economy.h
@@ -23,6 +23,7 @@ VARDEF Economy _economy;
typedef struct Subsidy {
CargoID cargo_type;
byte age;
+ /* from and to can either be TownID, StationID or IndustryID */
uint16 from;
uint16 to;
} Subsidy;
diff --git a/openttd.h b/openttd.h
index b32d5c540..31f8c35df 100644
--- a/openttd.h
+++ b/openttd.h
@@ -61,6 +61,7 @@ typedef struct NewsItem NewsItem;
typedef struct Industry Industry;
typedef struct DrawPixelInfo DrawPixelInfo;
typedef uint16 VehicleID;
+typedef uint16 TownID;
typedef byte PlayerID;
typedef byte OrderID;
typedef byte CargoID;
diff --git a/town.h b/town.h
index 9bb590e2f..de52efda8 100644
--- a/town.h
+++ b/town.h
@@ -70,7 +70,7 @@ struct Town {
byte road_build_months;
// Index in town array
- uint16 index;
+ TownID index;
// NOSAVE: UpdateTownRadius updates this given the house count.
uint16 radius[5];
@@ -80,7 +80,7 @@ uint32 GetWorldPopulation(void);
void UpdateTownVirtCoord(Town *t);
void InitializeTown(void);
-void ShowTownViewWindow(uint town);
+void ShowTownViewWindow(TownID town);
void DeleteTown(Town *t);
void ExpandTown(Town *t);
Town *CreateRandomTown(uint attempts);
@@ -130,7 +130,7 @@ enum {
bool CheckforTownRating(uint32 flags, Town *t, byte type);
-VARDEF uint16 *_town_sort;
+VARDEF TownID *_town_sort;
extern MemoryPool _town_pool;
diff --git a/waypoint.h b/waypoint.h
index 04c39faba..4842d1a31 100644
--- a/waypoint.h
+++ b/waypoint.h
@@ -10,7 +10,7 @@ struct Waypoint {
TileIndex xy; ///< Tile of waypoint
uint16 index; ///< Index of waypoint
- uint16 town_index; ///< Town associated with the waypoint
+ TownID town_index; ///< Town associated with the waypoint
byte town_cn; ///< The Nth waypoint for this town (consecutive number)
StringID string; ///< If this is zero (i.e. no custom name), town + town_cn is used for naming