summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-06-10 09:37:09 +0000
committerbjarni <bjarni@openttd.org>2007-06-10 09:37:09 +0000
commite1b7b7aecc1b750bb2cc3c792d8c4898ebafe6c7 (patch)
treea3f89807a419c24468528ef047316249827bdab8 /src
parentfbcbd101c3c5c6e9a689e670698617483548ea93 (diff)
downloadopenttd-e1b7b7aecc1b750bb2cc3c792d8c4898ebafe6c7.tar.xz
(svn r10080) -Cleanup: replaced magic numbers in SubtractMoneyFromAnyPlayer() with enum values
Diffstat (limited to 'src')
-rw-r--r--src/players.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/players.cpp b/src/players.cpp
index f4cb38787..3a71b4d08 100644
--- a/src/players.cpp
+++ b/src/players.cpp
@@ -193,9 +193,17 @@ static void SubtractMoneyFromAnyPlayer(Player *p, int32 cost)
p->yearly_expenses[0][_yearly_expenses_type] += cost;
- if (HASBIT(1<<7|1<<8|1<<9|1<<10, _yearly_expenses_type)) {
+ if (HASBIT(1 << EXPENSES_TRAIN_INC |
+ 1 << EXPENSES_ROADVEH_INC |
+ 1 << EXPENSES_AIRCRAFT_INC |
+ 1 << EXPENSES_SHIP_INC, _yearly_expenses_type)) {
p->cur_economy.income -= cost;
- } else if (HASBIT(1<<2|1<<3|1<<4|1<<5|1<<6|1<<11, _yearly_expenses_type)) {
+ } else if (HASBIT(1 << EXPENSES_TRAIN_RUN |
+ 1 << EXPENSES_ROADVEH_RUN |
+ 1 << EXPENSES_AIRCRAFT_RUN |
+ 1 << EXPENSES_SHIP_RUN |
+ 1 << EXPENSES_PROPERTY |
+ 1 << EXPENSES_LOAN_INT, _yearly_expenses_type)) {
p->cur_economy.expenses -= cost;
}