equal
deleted
inserted
replaced
798 for (i=2;i<p->ainew.path_info.route_length-2;i++) { |
798 for (i=2;i<p->ainew.path_info.route_length-2;i++) { |
799 tile = p->ainew.path_info.route[i]; |
799 tile = p->ainew.path_info.route[i]; |
800 for (j = DIAGDIR_BEGIN; j < DIAGDIR_END; j++) { |
800 for (j = DIAGDIR_BEGIN; j < DIAGDIR_END; j++) { |
801 TileIndex t = tile + TileOffsByDiagDir(j); |
801 TileIndex t = tile + TileOffsByDiagDir(j); |
802 |
802 |
803 if (IsTileType(t, MP_STREET) && |
803 if (IsTileType(t, MP_ROAD) && |
804 GetRoadTileType(t) == ROAD_TILE_DEPOT && |
804 GetRoadTileType(t) == ROAD_TILE_DEPOT && |
805 IsTileOwner(t, _current_player) && |
805 IsTileOwner(t, _current_player) && |
806 GetRoadDepotDirection(t) == ReverseDiagDir(j)) { |
806 GetRoadDepotDirection(t) == ReverseDiagDir(j)) { |
807 p->ainew.depot_tile = t; |
807 p->ainew.depot_tile = t; |
808 p->ainew.depot_direction = ReverseDiagDir(j); |
808 p->ainew.depot_direction = ReverseDiagDir(j); |
1099 static void AiNew_State_BuildDepot(Player *p) |
1099 static void AiNew_State_BuildDepot(Player *p) |
1100 { |
1100 { |
1101 CommandCost res; |
1101 CommandCost res; |
1102 assert(p->ainew.state == AI_STATE_BUILD_DEPOT); |
1102 assert(p->ainew.state == AI_STATE_BUILD_DEPOT); |
1103 |
1103 |
1104 if (IsTileType(p->ainew.depot_tile, MP_STREET) && GetRoadTileType(p->ainew.depot_tile) == ROAD_TILE_DEPOT) { |
1104 if (IsTileType(p->ainew.depot_tile, MP_ROAD) && GetRoadTileType(p->ainew.depot_tile) == ROAD_TILE_DEPOT) { |
1105 if (IsTileOwner(p->ainew.depot_tile, _current_player)) { |
1105 if (IsTileOwner(p->ainew.depot_tile, _current_player)) { |
1106 // The depot is already built |
1106 // The depot is already built |
1107 p->ainew.state = AI_STATE_BUILD_VEHICLE; |
1107 p->ainew.state = AI_STATE_BUILD_VEHICLE; |
1108 return; |
1108 return; |
1109 } else { |
1109 } else { |