summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-07-18 16:40:29 +0000
committerrubidium <rubidium@openttd.org>2008-07-18 16:40:29 +0000
commitcde65455acbc10a3f64bb9d43c03b37cdf9b1c55 (patch)
tree82319a3d42401c6d6fa4944e99863807f05c6f5f /src/engine.cpp
parent56ad26a3aa231ede631d5bf8cf7e5132b2ff25a1 (diff)
downloadopenttd-cde65455acbc10a3f64bb9d43c03b37cdf9b1c55.tar.xz
(svn r13731) -Codechange: make a pool of the array of players.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 71e09773b..6712860f3 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -313,7 +313,7 @@ static PlayerID GetBestPlayer(uint8 pp)
best_hist = -1;
best_player = PLAYER_SPECTATOR;
FOR_ALL_PLAYERS(p) {
- if (p->is_active && p->block_preview == 0 && !HasBit(mask, p->index) &&
+ if (p->block_preview == 0 && !HasBit(mask, p->index) &&
p->old_economy[0].performance_history > best_hist) {
best_hist = p->old_economy[0].performance_history;
best_player = p->index;
@@ -428,14 +428,10 @@ static void NewVehicleAvailable(Engine *e)
/* maybe make another rail type available */
RailType railtype = e->u.rail.railtype;
assert(railtype < RAILTYPE_END);
- FOR_ALL_PLAYERS(p) {
- if (p->is_active) SetBit(p->avail_railtypes, railtype);
- }
+ FOR_ALL_PLAYERS(p) SetBit(p->avail_railtypes, railtype);
} else if (e->type == VEH_ROAD) {
/* maybe make another road type available */
- FOR_ALL_PLAYERS(p) {
- if (p->is_active) SetBit(p->avail_roadtypes, HasBit(e->info.misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD);
- }
+ FOR_ALL_PLAYERS(p) SetBit(p->avail_roadtypes, HasBit(e->info.misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD);
}
SetDParam(0, GetEngineCategoryName(index));