summaryrefslogtreecommitdiff
path: root/src/economy_func.h
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-11-13 09:45:20 +0000
committeralberth <alberth@openttd.org>2010-11-13 09:45:20 +0000
commit43f807a9189a1dde0260f40f8553bcc8050a3e1d (patch)
tree468331788816bd2a4b941bf10b20690921ed3dd1 /src/economy_func.h
parentaea8274dbad2da74eed8dba284b66b29be60a408 (diff)
downloadopenttd-43f807a9189a1dde0260f40f8553bcc8050a3e1d.tar.xz
(svn r21156) -Codechange: Introduce EconomyIsInRecession().
Diffstat (limited to 'src/economy_func.h')
-rw-r--r--src/economy_func.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/economy_func.h b/src/economy_func.h
index dfeefbb9c..e9c9c170d 100644
--- a/src/economy_func.h
+++ b/src/economy_func.h
@@ -42,4 +42,13 @@ void InitializeEconomy();
void RecomputePrices();
void AddInflation(bool check_year = true);
+/**
+ * Is the economy in recession?
+ * @return \c True if economy is in recession, \c false otherwise.
+ */
+static inline bool EconomyIsInRecession()
+{
+ return _economy.fluct <= 0;
+}
+
#endif /* ECONOMY_FUNC_H */