summaryrefslogtreecommitdiff
path: root/signs.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-26 14:22:54 +0000
committertruelight <truelight@openttd.org>2006-08-26 14:22:54 +0000
commit602c0d40b38c83e520667ec1585b7745278fbbf8 (patch)
tree3ffa0a94034a5993e48411c7cb9b2cb765c6b1de /signs.h
parentbe737b80d35aebf98a7fb571b1124cd51b371953 (diff)
downloadopenttd-602c0d40b38c83e520667ec1585b7745278fbbf8.tar.xz
(svn r6137) -Codechange: some very minor cleanups:
- Start using DeleteXXX for every pool item, not manually doing it - Use some wrapper to improve logic - Rewrote some pieces to improve logic
Diffstat (limited to 'signs.h')
-rw-r--r--signs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/signs.h b/signs.h
index f61db4511..e2d5f9f7f 100644
--- a/signs.h
+++ b/signs.h
@@ -57,6 +57,12 @@ static inline bool IsValidSignID(uint index)
return index < GetSignPoolSize() && IsValidSign(GetSign(index));
}
+static inline void DeleteSign(Sign *si)
+{
+ DeleteName(si->str);
+ si->str = STR_NULL;
+}
+
#define FOR_ALL_SIGNS_FROM(ss, start) for (ss = GetSign(start); ss != NULL; ss = (ss->index + 1 < GetSignPoolSize()) ? GetSign(ss->index + 1) : NULL) if (IsValidSign(ss))
#define FOR_ALL_SIGNS(ss) FOR_ALL_SIGNS_FROM(ss, 0)