summaryrefslogtreecommitdiff
path: root/industry.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-26 19:51:49 +0000
committertruelight <truelight@openttd.org>2006-08-26 19:51:49 +0000
commitb7fcce091eba6ab8603f7ae10d8952c26015baf7 (patch)
tree6ea2d59fac96e685c5333e8f358b59b50f7f67a4 /industry.h
parentb3cf0189a3163781fb661e9b1431b5c381d18c80 (diff)
downloadopenttd-b7fcce091eba6ab8603f7ae10d8952c26015baf7.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.h8
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)