|
@@ -131,25 +131,26 @@ RoadStop *Station::GetPrimaryRoadStop(co
|
|
|
/* The vehicle cannot go to this roadstop (different roadtype) */
|
|
|
if ((GetRoadTypes(rs->xy) & v->compatible_roadtypes) == ROADTYPES_NONE) continue;
|
|
|
/* The vehicle is articulated and can therefor not go the a standard road stop */
|
|
|
if (IsStandardRoadStopTile(rs->xy) && v->HasArticulatedPart()) continue;
|
|
|
|
|
|
/* The vehicle can actually go to this road stop. So, return it! */
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
/** Called when new facility is built on the station. If it is the first facility
|
|
|
/**
|
|
|
* Called when new facility is built on the station. If it is the first facility
|
|
|
* it initializes also 'xy' and 'random_bits' members */
|
|
|
void Station::AddFacility(StationFacility new_facility_bit, TileIndex facil_xy)
|
|
|
{
|
|
|
if (this->facilities == FACIL_NONE) {
|
|
|
this->xy = facil_xy;
|
|
|
this->random_bits = Random();
|
|
|
}
|
|
|
this->facilities |= new_facility_bit;
|
|
|
this->owner = _current_company;
|
|
|
this->build_date = _date;
|
|
|
}
|
|
|
|
|
@@ -208,25 +209,26 @@ void Station::MarkTilesDirty(bool cargo_
|
|
|
uint length = 0;
|
|
|
assert(IsRailStationTile(tile));
|
|
|
assert(dir < DIAGDIR_END);
|
|
|
|
|
|
do {
|
|
|
length++;
|
|
|
tile += TileOffsByDiagDir(dir);
|
|
|
} while (IsCompatibleTrainStationTile(tile, start_tile));
|
|
|
|
|
|
return length;
|
|
|
}
|
|
|
|
|
|
/** Determines the catchment radius of the station
|
|
|
/**
|
|
|
* Determines the catchment radius of the station
|
|
|
* @return The radius
|
|
|
*/
|
|
|
uint Station::GetCatchmentRadius() const
|
|
|
{
|
|
|
uint ret = CA_NONE;
|
|
|
|
|
|
if (_settings_game.station.modified_catchment) {
|
|
|
if (this->bus_stops != NULL) ret = max<uint>(ret, CA_BUS);
|
|
|
if (this->truck_stops != NULL) ret = max<uint>(ret, CA_TRUCK);
|
|
|
if (this->train_station.tile != INVALID_TILE) ret = max<uint>(ret, CA_TRAIN);
|
|
|
if (this->dock_tile != INVALID_TILE) ret = max<uint>(ret, CA_DOCK);
|
|
|
if (this->airport.tile != INVALID_TILE) ret = max<uint>(ret, this->airport.GetSpec()->catchment);
|