equal
deleted
inserted
replaced
131 |
131 |
132 for (i = 0; i < NUM_TRAIN_ENGINES; i++) { |
132 for (i = 0; i < NUM_TRAIN_ENGINES; i++) { |
133 const RailVehicleInfo *rvi = RailVehInfo(i); |
133 const RailVehicleInfo *rvi = RailVehInfo(i); |
134 const Engine* e = GetEngine(i); |
134 const Engine* e = GetEngine(i); |
135 |
135 |
136 if (e->railtype != railtype || rvi->flags & RVI_WAGON |
136 if (e->railtype != railtype || |
137 || !HASBIT(e->player_avail, _current_player) || e->reliability < 0x8A3D) |
137 rvi->flags & RVI_WAGON || |
|
138 (rvi->flags & RVI_MULTIHEAD && flag & 1) || |
|
139 !HASBIT(e->player_avail, _current_player) || |
|
140 e->reliability < 0x8A3D) { |
138 continue; |
141 continue; |
|
142 } |
139 |
143 |
140 ret = DoCommandByTile(tile, i, 0, 0, CMD_BUILD_RAIL_VEHICLE); |
144 ret = DoCommandByTile(tile, i, 0, 0, CMD_BUILD_RAIL_VEHICLE); |
141 if (!CmdFailed(ret) && (!(_cmd_build_rail_veh_var1&1) || !(flag&1)) && ret <= money && |
145 if (!CmdFailed(ret) && ret <= money && |
142 _cmd_build_rail_veh_score >= best_veh_score) { |
146 _cmd_build_rail_veh_score >= best_veh_score) { |
143 best_veh_score = _cmd_build_rail_veh_score; |
147 best_veh_score = _cmd_build_rail_veh_score; |
144 best_veh_index = i; |
148 best_veh_index = i; |
145 } |
149 } |
146 } |
150 } |