diff options
author | rubidium <rubidium@openttd.org> | 2008-07-18 16:40:29 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-07-18 16:40:29 +0000 |
commit | cde65455acbc10a3f64bb9d43c03b37cdf9b1c55 (patch) | |
tree | 82319a3d42401c6d6fa4944e99863807f05c6f5f /src/ai | |
parent | 56ad26a3aa231ede631d5bf8cf7e5132b2ff25a1 (diff) | |
download | openttd-cde65455acbc10a3f64bb9d43c03b37cdf9b1c55.tar.xz |
(svn r13731) -Codechange: make a pool of the array of players.
Diffstat (limited to 'src/ai')
-rw-r--r-- | src/ai/ai.cpp | 4 | ||||
-rw-r--r-- | src/ai/default/default.cpp | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/ai/ai.cpp b/src/ai/ai.cpp index c32f52ad8..1bf72f805 100644 --- a/src/ai/ai.cpp +++ b/src/ai/ai.cpp @@ -193,7 +193,7 @@ void AI_RunGameLoop() const Player* p; FOR_ALL_PLAYERS(p) { - if (p->is_active && p->is_ai) { + if (p->is_ai) { /* This should always be true, else something went wrong... */ assert(_ai_player[p->index].active); @@ -249,6 +249,6 @@ void AI_Uninitialize() const Player* p; FOR_ALL_PLAYERS(p) { - if (p->is_active && p->is_ai) AI_PlayerDied(p->index); + if (p->is_ai) AI_PlayerDied(p->index); } } diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp index 1e5fcbcb8..db91cdab3 100644 --- a/src/ai/default/default.cpp +++ b/src/ai/default/default.cpp @@ -3897,8 +3897,7 @@ static void AiHandleTakeover(Player *p) // Ask the guy with the highest performance hist. FOR_ALL_PLAYERS(pp) { - if (pp->is_active && - !(asked & 1) && + if (!(asked & 1) && pp->bankrupt_asked == 0 && best_val < pp->old_economy[1].performance_history) { best_val = pp->old_economy[1].performance_history; |