From b7fcce091eba6ab8603f7ae10d8952c26015baf7 Mon Sep 17 00:00:00 2001 From: truelight Date: Sat, 26 Aug 2006 19:51:49 +0000 Subject: (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. --- industry.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'industry.h') 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) -- cgit v1.2.3-70-g09d2