diff options
author | truelight <truelight@openttd.org> | 2006-08-26 19:51:49 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2006-08-26 19:51:49 +0000 |
commit | a241ec82c9203d3208701e359b253abb50483c60 (patch) | |
tree | 6ea2d59fac96e685c5333e8f358b59b50f7f67a4 /industry.h | |
parent | 55ab975c368118b8db667f97959ee60778961397 (diff) | |
download | openttd-a241ec82c9203d3208701e359b253abb50483c60.tar.xz |
(svn r6156) -Codechange: DeleteIndustry removes an industry from the pool
-Codechange: DestroyIndustry is called by DeleteIndustry to remove all things where a industry depends on.
Last 2 changes to prepare for new pool system. Not pretty now, will be soon.
Diffstat (limited to 'industry.h')
-rw-r--r-- | industry.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/industry.h b/industry.h index e4cbaa628..d654e0735 100644 --- a/industry.h +++ b/industry.h @@ -131,6 +131,14 @@ static inline Industry *GetRandomIndustry(void) return GetIndustry(index); } +void DestroyIndustry(Industry *i); + +static inline void DeleteIndustry(Industry *i) +{ + DestroyIndustry(i); + i->xy = 0; +} + #define FOR_ALL_INDUSTRIES_FROM(i, start) for (i = GetIndustry(start); i != NULL; i = (i->index + 1 < GetIndustryPoolSize()) ? GetIndustry(i->index + 1) : NULL) if (IsValidIndustry(i)) #define FOR_ALL_INDUSTRIES(i) FOR_ALL_INDUSTRIES_FROM(i, 0) |