summaryrefslogtreecommitdiff
path: root/town.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-26 18:05:05 +0000
committertruelight <truelight@openttd.org>2006-08-26 18:05:05 +0000
commitbb9f29ae1f49d4d935d343dd2e24d8d66ce938ce (patch)
treec18ac40dc8f148d3b3583c9e04d5b511c24faf0b /town.h
parentb7ecdc85d8b9dd3dc0de61947a490df2fcbffea4 (diff)
downloadopenttd-bb9f29ae1f49d4d935d343dd2e24d8d66ce938ce.tar.xz
(svn r6149) -Codechange: DeleteTown removes a town from the pool
-Codechange: DestroyTown is called by DeleteTown to remove all things where a town depends on. Last 2 changes to prepare for new pool system. Not pretty now, will be soon.
Diffstat (limited to 'town.h')
-rw-r--r--town.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/town.h b/town.h
index 4c54e6bf0..1e0c0b1bc 100644
--- a/town.h
+++ b/town.h
@@ -81,7 +81,6 @@ uint32 GetWorldPopulation(void);
void UpdateTownVirtCoord(Town *t);
void InitializeTown(void);
void ShowTownViewWindow(TownID town);
-void DeleteTown(Town *t);
void ExpandTown(Town *t);
Town *CreateRandomTown(uint attempts, uint size_mode);
@@ -218,6 +217,14 @@ static inline bool IsValidTownID(uint index)
return index < GetTownPoolSize() && IsValidTown(GetTown(index));
}
+void DestroyTown(Town *t);
+
+static inline void DeleteTown(Town *t)
+{
+ DestroyTown(t);
+ t->xy = 0;
+}
+
#define FOR_ALL_TOWNS_FROM(t, start) for (t = GetTown(start); t != NULL; t = (t->index + 1 < GetTownPoolSize()) ? GetTown(t->index + 1) : NULL) if (IsValidTown(t))
#define FOR_ALL_TOWNS(t) FOR_ALL_TOWNS_FROM(t, 0)