diff options
author | alberth <alberth@openttd.org> | 2010-11-13 09:45:20 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-11-13 09:45:20 +0000 |
commit | 43f807a9189a1dde0260f40f8553bcc8050a3e1d (patch) | |
tree | 468331788816bd2a4b941bf10b20690921ed3dd1 /src/economy_func.h | |
parent | aea8274dbad2da74eed8dba284b66b29be60a408 (diff) | |
download | openttd-43f807a9189a1dde0260f40f8553bcc8050a3e1d.tar.xz |
(svn r21156) -Codechange: Introduce EconomyIsInRecession().
Diffstat (limited to 'src/economy_func.h')
-rw-r--r-- | src/economy_func.h | 9 |
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 */ |