summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-09-01 08:31:36 +0000
committerrubidium <rubidium@openttd.org>2007-09-01 08:31:36 +0000
commit56ab253307c128cd99342ab1b6809e02b3fe9dcc (patch)
tree6358623fdcb900c9c4bcb968c9388b48c33f1cb5 /src/economy.cpp
parent0df355bbda0e97edb0c642188db663620dd2e4f6 (diff)
downloadopenttd-56ab253307c128cd99342ab1b6809e02b3fe9dcc.tar.xz
(svn r11031) -Codechange: reduce the amount of duplication of bit counting functions. Based on patches by skidd13, SmatZ and Belugas.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index b46c37796..a9b0d9229 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -70,7 +70,7 @@ Money CalculateCompanyValue(const Player* p)
uint num = 0;
FOR_ALL_STATIONS(st) {
- if (st->owner == owner) num += CountBitsSet(st->facilities);
+ if (st->owner == owner) num += COUNTBITS(st->facilities);
}
value.AddCost(num * _price.station_value * 25);
@@ -146,7 +146,7 @@ int UpdateCompanyRatingAndValue(Player *p, bool update)
const Station* st;
FOR_ALL_STATIONS(st) {
- if (st->owner == owner) num += CountBitsSet(st->facilities);
+ if (st->owner == owner) num += COUNTBITS(st->facilities);
}
_score_part[owner][SCORE_STATIONS] = num;
}
@@ -191,7 +191,7 @@ int UpdateCompanyRatingAndValue(Player *p, bool update)
/* Generate score for variety of cargo */
{
- uint num = CountBitsSet(p->cargo_types);
+ uint num = COUNTBITS(p->cargo_types);
_score_part[owner][SCORE_CARGO] = num;
if (update) p->cargo_types = 0;
}