changeset 6841:797e736c88a7 draft

(svn r10080) -Cleanup: replaced magic numbers in SubtractMoneyFromAnyPlayer() with enum values
author bjarni <bjarni@openttd.org>
date Sun, 10 Jun 2007 09:37:09 +0000
parents abc58e89bc63
children 4dda4076644b
files src/players.cpp
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/players.cpp
+++ b/src/players.cpp
@@ -193,9 +193,17 @@
 
 	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;
 	}