25 #include "water_map.h" |
25 #include "water_map.h" |
26 #include "industry_map.h" |
26 #include "industry_map.h" |
27 #include "newgrf_callbacks.h" |
27 #include "newgrf_callbacks.h" |
28 #include "newgrf_station.h" |
28 #include "newgrf_station.h" |
29 #include "yapf/yapf.h" |
29 #include "yapf/yapf.h" |
30 #include "misc/autoptr.hpp" |
|
31 #include "road_type.h" |
30 #include "road_type.h" |
32 #include "road_internal.h" /* For drawing catenary/checking road removal */ |
31 #include "road_internal.h" /* For drawing catenary/checking road removal */ |
33 #include "cargotype.h" |
32 #include "cargotype.h" |
34 #include "variables.h" |
33 #include "variables.h" |
35 #include "autoslope.h" |
34 #include "autoslope.h" |
237 STATIONNAMING_DOCK, |
236 STATIONNAMING_DOCK, |
238 STATIONNAMING_BUOY, |
237 STATIONNAMING_BUOY, |
239 STATIONNAMING_HELIPORT, |
238 STATIONNAMING_HELIPORT, |
240 }; |
239 }; |
241 |
240 |
242 static bool GenerateStationName(Station *st, TileIndex tile, int flag) |
241 static void GenerateStationName(Station *st, TileIndex tile, int flag) |
243 { |
242 { |
244 static const uint32 _gen_station_name_bits[] = { |
243 static const uint32 _gen_station_name_bits[] = { |
245 0, /* 0 */ |
244 0, /* 0 */ |
246 1 << M(STR_SV_STNAME_AIRPORT), /* 1 */ |
245 1 << M(STR_SV_STNAME_AIRPORT), /* 1 */ |
247 1 << M(STR_SV_STNAME_OILFIELD), /* 2 */ |
246 1 << M(STR_SV_STNAME_OILFIELD), /* 2 */ |
964 } |
962 } |
965 |
963 |
966 /* See if there is a deleted station close to us. */ |
964 /* See if there is a deleted station close to us. */ |
967 if (st == NULL) st = GetClosestStationFromTile(tile_org); |
965 if (st == NULL) st = GetClosestStationFromTile(tile_org); |
968 |
966 |
969 /* In case of new station if DC_EXEC is NOT set we still need to create the station |
|
970 * to test if everything is OK. In this case we need to delete it before return. */ |
|
971 AutoPtrT<Station> st_auto_delete; |
|
972 |
|
973 if (st != NULL) { |
967 if (st != NULL) { |
974 /* Reuse an existing station. */ |
968 /* Reuse an existing station. */ |
975 if (st->owner != _current_player) |
969 if (st->owner != _current_player) |
976 return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION); |
970 return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION); |
977 |
971 |
985 |
979 |
986 /* XXX can't we pack this in the "else" part of the if above? */ |
980 /* XXX can't we pack this in the "else" part of the if above? */ |
987 if (!st->rect.BeforeAddRect(tile_org, w_org, h_org, StationRect::ADD_TEST)) return CMD_ERROR; |
981 if (!st->rect.BeforeAddRect(tile_org, w_org, h_org, StationRect::ADD_TEST)) return CMD_ERROR; |
988 } else { |
982 } else { |
989 /* allocate and initialize new station */ |
983 /* allocate and initialize new station */ |
990 st = new Station(tile_org); |
984 if (!Station::CanAllocateItem()) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING); |
991 if (st == NULL) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING); |
985 |
992 |
986 if (flags & DC_EXEC) { |
993 /* ensure that in case of error (or no DC_EXEC) the station gets deleted upon return */ |
987 st = new Station(); |
994 st_auto_delete = st; |
988 |
995 |
989 st->town = ClosestTownFromTile(tile_org, (uint)-1); |
996 st->town = ClosestTownFromTile(tile_org, (uint)-1); |
990 GenerateStationName(st, tile_org, STATIONNAMING_RAIL); |
997 if (!GenerateStationName(st, tile_org, STATIONNAMING_RAIL)) return CMD_ERROR; |
991 |
998 |
992 if (IsValidPlayer(_current_player)) { |
999 if (IsValidPlayer(_current_player) && (flags & DC_EXEC) != 0) { |
993 SetBit(st->town->have_ratings, _current_player); |
1000 SetBit(st->town->have_ratings, _current_player); |
994 } |
1001 } |
995 } |
1002 } |
996 } |
1003 |
997 |
1004 /* Check if the given station class is valid */ |
998 /* Check if the given station class is valid */ |
1005 if (GB(p2, 8, 8) >= GetNumStationClasses()) return CMD_ERROR; |
999 if (GB(p2, 8, 8) >= GetNumStationClasses()) return CMD_ERROR; |
1080 UpdateStationVirtCoordDirty(st); |
1074 UpdateStationVirtCoordDirty(st); |
1081 UpdateStationAcceptance(st, false); |
1075 UpdateStationAcceptance(st, false); |
1082 RebuildStationLists(); |
1076 RebuildStationLists(); |
1083 InvalidateWindow(WC_STATION_LIST, st->owner); |
1077 InvalidateWindow(WC_STATION_LIST, st->owner); |
1084 InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_TRAINS); |
1078 InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_TRAINS); |
1085 /* success, so don't delete the new station */ |
|
1086 st_auto_delete.Detach(); |
|
1087 } |
1079 } |
1088 |
1080 |
1089 return cost; |
1081 return cost; |
1090 } |
1082 } |
1091 |
1083 |
1386 |
1378 |
1387 /* Find a station close to us */ |
1379 /* Find a station close to us */ |
1388 if (st == NULL) st = GetClosestStationFromTile(tile); |
1380 if (st == NULL) st = GetClosestStationFromTile(tile); |
1389 |
1381 |
1390 /* give us a road stop in the list, and check if something went wrong */ |
1382 /* give us a road stop in the list, and check if something went wrong */ |
1391 RoadStop *road_stop = new RoadStop(tile); |
1383 if (!RoadStop::CanAllocateItem()) return_cmd_error(type ? STR_TOO_MANY_TRUCK_STOPS : STR_TOO_MANY_BUS_STOPS); |
1392 if (road_stop == NULL) { |
|
1393 return_cmd_error(type ? STR_TOO_MANY_TRUCK_STOPS : STR_TOO_MANY_BUS_STOPS); |
|
1394 } |
|
1395 |
|
1396 /* ensure that in case of error (or no DC_EXEC) the new road stop gets deleted upon return */ |
|
1397 AutoPtrT<RoadStop> rs_auto_delete(road_stop); |
|
1398 |
1384 |
1399 if (st != NULL && |
1385 if (st != NULL && |
1400 GetNumRoadStopsInStation(st, RoadStop::BUS) + GetNumRoadStopsInStation(st, RoadStop::TRUCK) >= RoadStop::LIMIT) { |
1386 GetNumRoadStopsInStation(st, RoadStop::BUS) + GetNumRoadStopsInStation(st, RoadStop::TRUCK) >= RoadStop::LIMIT) { |
1401 return_cmd_error(type ? STR_TOO_MANY_TRUCK_STOPS : STR_TOO_MANY_BUS_STOPS); |
1387 return_cmd_error(type ? STR_TOO_MANY_TRUCK_STOPS : STR_TOO_MANY_BUS_STOPS); |
1402 } |
1388 } |
1403 |
1389 |
1404 /* In case of new station if DC_EXEC is NOT set we still need to create the station |
|
1405 * to test if everything is OK. In this case we need to delete it before return. */ |
|
1406 AutoPtrT<Station> st_auto_delete; |
|
1407 |
|
1408 if (st != NULL) { |
1390 if (st != NULL) { |
1409 if (st->owner != _current_player) { |
1391 if (st->owner != _current_player) { |
1410 return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION); |
1392 return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION); |
1411 } |
1393 } |
1412 |
1394 |
1413 if (!st->rect.BeforeAddTile(tile, StationRect::ADD_TEST)) return CMD_ERROR; |
1395 if (!st->rect.BeforeAddTile(tile, StationRect::ADD_TEST)) return CMD_ERROR; |
1414 } else { |
1396 } else { |
1415 /* allocate and initialize new station */ |
1397 /* allocate and initialize new station */ |
1416 st = new Station(tile); |
1398 if (!Station::CanAllocateItem()) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING); |
1417 if (st == NULL) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING); |
1399 |
1418 |
1400 if (flags & DC_EXEC) { |
1419 /* ensure that in case of error (or no DC_EXEC) the new station gets deleted upon return */ |
1401 st = new Station(); |
1420 st_auto_delete = st; |
1402 |
1421 |
1403 st->town = ClosestTownFromTile(tile, (uint)-1); |
1422 |
1404 GenerateStationName(st, tile, STATIONNAMING_ROAD); |
1423 Town *t = st->town = ClosestTownFromTile(tile, (uint)-1); |
1405 |
1424 if (!GenerateStationName(st, tile, STATIONNAMING_ROAD)) return CMD_ERROR; |
1406 if (IsValidPlayer(_current_player)) { |
1425 |
1407 SetBit(st->town->have_ratings, _current_player); |
1426 if (IsValidPlayer(_current_player) && (flags & DC_EXEC) != 0) { |
1408 } |
1427 SetBit(t->have_ratings, _current_player); |
1409 st->sign.width_1 = 0; |
1428 } |
1410 } |
1429 |
|
1430 st->sign.width_1 = 0; |
|
1431 } |
1411 } |
1432 |
1412 |
1433 cost.AddCost((type) ? _price.build_truck_station : _price.build_bus_station); |
1413 cost.AddCost((type) ? _price.build_truck_station : _price.build_bus_station); |
1434 |
1414 |
1435 if (flags & DC_EXEC) { |
1415 if (flags & DC_EXEC) { |
|
1416 RoadStop *road_stop = new RoadStop(tile); |
1436 /* Insert into linked list of RoadStops */ |
1417 /* Insert into linked list of RoadStops */ |
1437 RoadStop **currstop = FindRoadStopSpot(type, st); |
1418 RoadStop **currstop = FindRoadStopSpot(type, st); |
1438 *currstop = road_stop; |
1419 *currstop = road_stop; |
1439 |
1420 |
1440 /*initialize an empty station */ |
1421 /*initialize an empty station */ |
1452 UpdateStationVirtCoordDirty(st); |
1433 UpdateStationVirtCoordDirty(st); |
1453 UpdateStationAcceptance(st, false); |
1434 UpdateStationAcceptance(st, false); |
1454 RebuildStationLists(); |
1435 RebuildStationLists(); |
1455 InvalidateWindow(WC_STATION_LIST, st->owner); |
1436 InvalidateWindow(WC_STATION_LIST, st->owner); |
1456 InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_ROADVEHS); |
1437 InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_ROADVEHS); |
1457 /* success, so don't delete the new station and the new road stop */ |
|
1458 st_auto_delete.Detach(); |
|
1459 rs_auto_delete.Detach(); |
|
1460 } |
1438 } |
1461 return cost; |
1439 return cost; |
1462 } |
1440 } |
1463 |
1441 |
1464 |
1442 |
1709 if (w > _patches.station_spread || h > _patches.station_spread) { |
1687 if (w > _patches.station_spread || h > _patches.station_spread) { |
1710 _error_message = STR_306C_STATION_TOO_SPREAD_OUT; |
1688 _error_message = STR_306C_STATION_TOO_SPREAD_OUT; |
1711 return CMD_ERROR; |
1689 return CMD_ERROR; |
1712 } |
1690 } |
1713 |
1691 |
1714 /* In case of new station if DC_EXEC is NOT set we still need to create the station |
|
1715 * to test if everything is OK. In this case we need to delete it before return. */ |
|
1716 AutoPtrT<Station> st_auto_delete; |
|
1717 |
|
1718 if (st != NULL) { |
1692 if (st != NULL) { |
1719 if (st->owner != _current_player) |
1693 if (st->owner != _current_player) |
1720 return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION); |
1694 return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION); |
1721 |
1695 |
1722 if (!st->rect.BeforeAddRect(tile, w, h, StationRect::ADD_TEST)) return CMD_ERROR; |
1696 if (!st->rect.BeforeAddRect(tile, w, h, StationRect::ADD_TEST)) return CMD_ERROR; |
1725 return_cmd_error(STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT); |
1699 return_cmd_error(STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT); |
1726 } else { |
1700 } else { |
1727 airport_upgrade = false; |
1701 airport_upgrade = false; |
1728 |
1702 |
1729 /* allocate and initialize new station */ |
1703 /* allocate and initialize new station */ |
1730 st = new Station(tile); |
1704 if (!Station::CanAllocateItem()) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING); |
1731 if (st == NULL) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING); |
1705 |
1732 |
1706 if (flags & DC_EXEC) { |
1733 /* ensure that in case of error (or no DC_EXEC) the station gets deleted upon return */ |
1707 st = new Station(); |
1734 st_auto_delete = st; |
1708 |
1735 |
1709 st->town = ClosestTownFromTile(tile, (uint)-1); |
1736 st->town = t; |
1710 GenerateStationName(st, tile, !(afc->flags & AirportFTAClass::AIRPLANES) ? STATIONNAMING_HELIPORT : STATIONNAMING_AIRPORT); |
1737 |
1711 |
1738 if (IsValidPlayer(_current_player) && (flags & DC_EXEC) != 0) { |
1712 if (IsValidPlayer(_current_player)) { |
1739 SetBit(t->have_ratings, _current_player); |
1713 SetBit(st->town->have_ratings, _current_player); |
1740 } |
1714 } |
1741 |
1715 st->sign.width_1 = 0; |
1742 st->sign.width_1 = 0; |
|
1743 |
|
1744 /* If only helicopters may use the airport generate a helicopter related (5) |
|
1745 * station name, otherwise generate a normal airport name (1) */ |
|
1746 if (!GenerateStationName(st, tile, !(afc->flags & AirportFTAClass::AIRPLANES) ? STATIONNAMING_HELIPORT : STATIONNAMING_AIRPORT)) { |
|
1747 return CMD_ERROR; |
|
1748 } |
1716 } |
1749 } |
1717 } |
1750 |
1718 |
1751 cost.AddCost(_price.build_airport * w * h); |
1719 cost.AddCost(_price.build_airport * w * h); |
1752 |
1720 |
1779 UpdateStationVirtCoordDirty(st); |
1747 UpdateStationVirtCoordDirty(st); |
1780 UpdateStationAcceptance(st, false); |
1748 UpdateStationAcceptance(st, false); |
1781 RebuildStationLists(); |
1749 RebuildStationLists(); |
1782 InvalidateWindow(WC_STATION_LIST, st->owner); |
1750 InvalidateWindow(WC_STATION_LIST, st->owner); |
1783 InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_PLANES); |
1751 InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_PLANES); |
1784 /* success, so don't delete the new station */ |
|
1785 st_auto_delete.Detach(); |
|
1786 } |
1752 } |
1787 |
1753 |
1788 return cost; |
1754 return cost; |
1789 } |
1755 } |
1790 |
1756 |
1849 if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST); |
1815 if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST); |
1850 |
1816 |
1851 if (GetTileSlope(tile, NULL) != SLOPE_FLAT) return_cmd_error(STR_304B_SITE_UNSUITABLE); |
1817 if (GetTileSlope(tile, NULL) != SLOPE_FLAT) return_cmd_error(STR_304B_SITE_UNSUITABLE); |
1852 |
1818 |
1853 /* allocate and initialize new station */ |
1819 /* allocate and initialize new station */ |
1854 Station *st = new Station(tile); |
1820 if (!Station::CanAllocateItem()) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING); |
1855 if (st == NULL) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING); |
|
1856 |
|
1857 /* ensure that in case of error (or no DC_EXEC) the station gets deleted upon return */ |
|
1858 AutoPtrT<Station> st_auto_delete(st); |
|
1859 |
|
1860 st->town = ClosestTownFromTile(tile, (uint)-1); |
|
1861 st->sign.width_1 = 0; |
|
1862 |
|
1863 if (!GenerateStationName(st, tile, STATIONNAMING_BUOY)) return CMD_ERROR; |
|
1864 |
1821 |
1865 if (flags & DC_EXEC) { |
1822 if (flags & DC_EXEC) { |
|
1823 Station *st = new Station(); |
|
1824 |
|
1825 st->town = ClosestTownFromTile(tile, (uint)-1); |
|
1826 GenerateStationName(st, tile, STATIONNAMING_BUOY); |
|
1827 |
|
1828 if (IsValidPlayer(_current_player)) { |
|
1829 SetBit(st->town->have_ratings, _current_player); |
|
1830 } |
|
1831 st->sign.width_1 = 0; |
1866 st->dock_tile = tile; |
1832 st->dock_tile = tile; |
1867 st->facilities |= FACIL_DOCK; |
1833 st->facilities |= FACIL_DOCK; |
1868 /* Buoys are marked in the Station struct by this flag. Yes, it is this |
1834 /* Buoys are marked in the Station struct by this flag. Yes, it is this |
1869 * braindead.. */ |
1835 * braindead.. */ |
1870 st->had_vehicle_of_type |= HVOT_BUOY; |
1836 st->had_vehicle_of_type |= HVOT_BUOY; |
1877 UpdateStationVirtCoordDirty(st); |
1843 UpdateStationVirtCoordDirty(st); |
1878 UpdateStationAcceptance(st, false); |
1844 UpdateStationAcceptance(st, false); |
1879 RebuildStationLists(); |
1845 RebuildStationLists(); |
1880 InvalidateWindow(WC_STATION_LIST, st->owner); |
1846 InvalidateWindow(WC_STATION_LIST, st->owner); |
1881 InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_SHIPS); |
1847 InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_SHIPS); |
1882 /* success, so don't delete the new station */ |
|
1883 st_auto_delete.Detach(); |
|
1884 } |
1848 } |
1885 |
1849 |
1886 return CommandCost(EXPENSES_CONSTRUCTION, _price.build_dock); |
1850 return CommandCost(EXPENSES_CONSTRUCTION, _price.build_dock); |
1887 } |
1851 } |
1888 |
1852 |
2004 } |
1968 } |
2005 |
1969 |
2006 /* Find a station close to us */ |
1970 /* Find a station close to us */ |
2007 if (st == NULL) st = GetClosestStationFromTile(tile); |
1971 if (st == NULL) st = GetClosestStationFromTile(tile); |
2008 |
1972 |
2009 /* In case of new station if DC_EXEC is NOT set we still need to create the station |
|
2010 * to test if everything is OK. In this case we need to delete it before return. */ |
|
2011 AutoPtrT<Station> st_auto_delete; |
|
2012 |
|
2013 if (st != NULL) { |
1973 if (st != NULL) { |
2014 if (st->owner != _current_player) |
1974 if (st->owner != _current_player) |
2015 return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION); |
1975 return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION); |
2016 |
1976 |
2017 if (!st->rect.BeforeAddRect(tile, _dock_w_chk[direction], _dock_h_chk[direction], StationRect::ADD_TEST)) return CMD_ERROR; |
1977 if (!st->rect.BeforeAddRect(tile, _dock_w_chk[direction], _dock_h_chk[direction], StationRect::ADD_TEST)) return CMD_ERROR; |
2018 |
1978 |
2019 if (st->dock_tile != 0) return_cmd_error(STR_304C_TOO_CLOSE_TO_ANOTHER_DOCK); |
1979 if (st->dock_tile != 0) return_cmd_error(STR_304C_TOO_CLOSE_TO_ANOTHER_DOCK); |
2020 } else { |
1980 } else { |
2021 /* allocate and initialize new station */ |
1981 /* allocate and initialize new station */ |
2022 st = new Station(tile); |
1982 /* allocate and initialize new station */ |
2023 if (st == NULL) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING); |
1983 if (!Station::CanAllocateItem()) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING); |
2024 |
1984 |
2025 /* ensure that in case of error (or no DC_EXEC) the station gets deleted upon return */ |
1985 if (flags & DC_EXEC) { |
2026 st_auto_delete = st; |
1986 st = new Station(); |
2027 |
1987 |
2028 Town *t = st->town = ClosestTownFromTile(tile, (uint)-1); |
1988 st->town = ClosestTownFromTile(tile, (uint)-1); |
2029 |
1989 GenerateStationName(st, tile, STATIONNAMING_DOCK); |
2030 if (IsValidPlayer(_current_player) && (flags & DC_EXEC) != 0) { |
1990 |
2031 SetBit(t->have_ratings, _current_player); |
1991 if (IsValidPlayer(_current_player)) { |
2032 } |
1992 SetBit(st->town->have_ratings, _current_player); |
2033 |
1993 } |
2034 st->sign.width_1 = 0; |
1994 } |
2035 |
|
2036 if (!GenerateStationName(st, tile, STATIONNAMING_DOCK)) return CMD_ERROR; |
|
2037 } |
1995 } |
2038 |
1996 |
2039 if (flags & DC_EXEC) { |
1997 if (flags & DC_EXEC) { |
2040 st->dock_tile = tile; |
1998 st->dock_tile = tile; |
2041 st->AddFacility(FACIL_DOCK, tile); |
1999 st->AddFacility(FACIL_DOCK, tile); |
2047 UpdateStationVirtCoordDirty(st); |
2005 UpdateStationVirtCoordDirty(st); |
2048 UpdateStationAcceptance(st, false); |
2006 UpdateStationAcceptance(st, false); |
2049 RebuildStationLists(); |
2007 RebuildStationLists(); |
2050 InvalidateWindow(WC_STATION_LIST, st->owner); |
2008 InvalidateWindow(WC_STATION_LIST, st->owner); |
2051 InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_SHIPS); |
2009 InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_SHIPS); |
2052 /* success, so don't delete the new station */ |
|
2053 st_auto_delete.Detach(); |
|
2054 } |
2010 } |
2055 return CommandCost(EXPENSES_CONSTRUCTION, _price.build_dock); |
2011 return CommandCost(EXPENSES_CONSTRUCTION, _price.build_dock); |
2056 } |
2012 } |
2057 |
2013 |
2058 static CommandCost RemoveDock(Station *st, uint32 flags) |
2014 static CommandCost RemoveDock(Station *st, uint32 flags) |
2846 } |
2802 } |
2847 |
2803 |
2848 st->town = ClosestTownFromTile(tile, (uint)-1); |
2804 st->town = ClosestTownFromTile(tile, (uint)-1); |
2849 st->sign.width_1 = 0; |
2805 st->sign.width_1 = 0; |
2850 |
2806 |
2851 if (!GenerateStationName(st, tile, STATIONNAMING_OILRIG)) { |
2807 GenerateStationName(st, tile, STATIONNAMING_OILRIG); |
2852 DEBUG(misc, 0, "Can't allocate station-name for oilrig at 0x%X, reverting to oilrig only", tile); |
|
2853 delete st; |
|
2854 return; |
|
2855 } |
|
2856 |
2808 |
2857 MakeOilrig(tile, st->index); |
2809 MakeOilrig(tile, st->index); |
2858 |
2810 |
2859 st->owner = OWNER_NONE; |
2811 st->owner = OWNER_NONE; |
2860 st->airport_flags = 0; |
2812 st->airport_flags = 0; |