summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2007-04-01 10:54:31 +0000
committercelestar <celestar@openttd.org>2007-04-01 10:54:31 +0000
commite3f1914de0549ced9800ce9aae60b294539e38af (patch)
tree5830b47b27a86849f761d5df0aba5c5ba129828c /src/ai
parent32c3ba66043cbac01ad2687d3d7b025e1db1f048 (diff)
downloadopenttd-e3f1914de0549ced9800ce9aae60b294539e38af.tar.xz
(svn r9540) -Fix (r1): Bankrupt AIs no longer buy themselves (usage of wrong variable)
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/default/default.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index 258935f73..5dc7a16f4 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -3822,7 +3822,7 @@ static void AiHandleTakeover(Player *p)
if (best_pl->player_money >> 1 >= p->bankrupt_value) {
// Computer wants to buy it.
PlayerID old_p = _current_player;
- _current_player = p->index;
+ _current_player = best_pl->index;
DoCommand(0, old_p, 0, DC_EXEC, CMD_BUY_COMPANY);
_current_player = old_p;
}