summaryrefslogtreecommitdiff
path: root/src/subsidy_base.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-07-18 19:54:35 +0000
committersmatz <smatz@openttd.org>2009-07-18 19:54:35 +0000
commitaf13707e0085ff0b273a1f1577c4e1855dedfbe1 (patch)
tree23f18152ec75a44d0ba7074cb092c18979a24c09 /src/subsidy_base.h
parent3fcfb9b248bd228d5885974858a14724205626ad (diff)
downloadopenttd-af13707e0085ff0b273a1f1577c4e1855dedfbe1.tar.xz
(svn r16877) -Codechange: use Subsidy::IsAwarded() instead of testing subsidy's age
Diffstat (limited to 'src/subsidy_base.h')
-rw-r--r--src/subsidy_base.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/subsidy_base.h b/src/subsidy_base.h
index aaba0fea5..adb03f83b 100644
--- a/src/subsidy_base.h
+++ b/src/subsidy_base.h
@@ -18,6 +18,15 @@ struct Subsidy {
uint16 to; ///< Index of destination. Either TownID, IndustryID or StationID, when awarded
/**
+ * Tests whether this subsidy has been awarded to someone
+ * @return is this subsidy awarded?
+ */
+ FORCEINLINE bool IsAwarded() const
+ {
+ return this->age >= 12;
+ }
+
+ /**
* Determines index of this subsidy
* @return index (in the Subsidy::array array)
*/