From 3a799389ebf915cc59b6e85346d837621ebe771a Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 18 Jul 2008 16:40:29 +0000 Subject: (svn r13731) -Codechange: make a pool of the array of players. --- src/engine.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/engine.cpp') 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)); -- cgit v1.2.3-54-g00ecf