summaryrefslogtreecommitdiff
path: root/ai/default/default.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-10-16 14:12:21 +0000
committertron <tron@openttd.org>2005-10-16 14:12:21 +0000
commit9314ea877fbe32ed9acbe6675693cc9f1d423192 (patch)
tree987abda890df302531f52ed26352ad76c6d35bfc /ai/default/default.c
parent0834a88a12906cd207957892156c3ac0d9d66a93 (diff)
downloadopenttd-9314ea877fbe32ed9acbe6675693cc9f1d423192.tar.xz
(svn r3052) Fix last commit *grml*
Diffstat (limited to 'ai/default/default.c')
-rw-r--r--ai/default/default.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/ai/default/default.c b/ai/default/default.c
index 59227e32a..8257b0026 100644
--- a/ai/default/default.c
+++ b/ai/default/default.c
@@ -133,16 +133,12 @@ static int AiChooseTrainToBuild(byte railtype, int32 money, byte flag, TileIndex
const RailVehicleInfo *rvi = RailVehInfo(i);
const Engine* e = GetEngine(i);
- if (e->railtype != railtype ||
- rvi->flags & RVI_WAGON ||
- (rvi->flags & RVI_MULTIHEAD && flag & 1) ||
- !HASBIT(e->player_avail, _current_player) ||
- e->reliability < 0x8A3D) {
+ if (e->railtype != railtype || rvi->flags & RVI_WAGON
+ || !HASBIT(e->player_avail, _current_player) || e->reliability < 0x8A3D)
continue;
- }
ret = DoCommandByTile(tile, i, 0, 0, CMD_BUILD_RAIL_VEHICLE);
- if (!CmdFailed(ret) && ret <= money &&
+ if (!CmdFailed(ret) && (!(_cmd_build_rail_veh_var1&1) || !(flag&1)) && ret <= money &&
_cmd_build_rail_veh_score >= best_veh_score) {
best_veh_score = _cmd_build_rail_veh_score;
best_veh_index = i;