|
|
|
@ -455,11 +455,12 @@ bool Station::CatchmentCoversTown(TownID t) const
|
|
|
|
|
/**
|
|
|
|
|
* Recompute tiles covered in our catchment area.
|
|
|
|
|
* This will additionally recompute nearby towns and industries.
|
|
|
|
|
* @param no_clear_nearby_lists If Station::RemoveFromAllNearbyLists does not need to be called.
|
|
|
|
|
*/
|
|
|
|
|
void Station::RecomputeCatchment()
|
|
|
|
|
void Station::RecomputeCatchment(bool no_clear_nearby_lists)
|
|
|
|
|
{
|
|
|
|
|
this->industries_near.clear();
|
|
|
|
|
this->RemoveFromAllNearbyLists();
|
|
|
|
|
if (!no_clear_nearby_lists) this->RemoveFromAllNearbyLists();
|
|
|
|
|
|
|
|
|
|
if (this->rect.IsEmpty()) {
|
|
|
|
|
this->catchment_tiles.Reset();
|
|
|
|
@ -526,7 +527,9 @@ void Station::RecomputeCatchment()
|
|
|
|
|
*/
|
|
|
|
|
/* static */ void Station::RecomputeCatchmentForAll()
|
|
|
|
|
{
|
|
|
|
|
for (Station *st : Station::Iterate()) { st->RecomputeCatchment(); }
|
|
|
|
|
for (Town *t : Town::Iterate()) { t->stations_near.clear(); }
|
|
|
|
|
for (Industry *i : Industry::Iterate()) { i->stations_near.clear(); }
|
|
|
|
|
for (Station *st : Station::Iterate()) { st->RecomputeCatchment(true); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|