Update to 1.10.2

This commit is contained in:
Pavel Stupnikov
2020-06-02 02:55:21 +03:00
121 changed files with 570 additions and 270 deletions
+6 -14
View File
@@ -1698,20 +1698,12 @@ static void PopulateStationsNearby(Industry *ind)
return;
}
/* Get our list of nearby stations. */
FindStationsAroundTiles(ind->location, &ind->stations_near, false);
/* Test if industry can accept cargo */
uint cargo_index;
for (cargo_index = 0; cargo_index < lengthof(ind->accepts_cargo); cargo_index++) {
if (ind->accepts_cargo[cargo_index] != CT_INVALID) break;
}
if (cargo_index >= lengthof(ind->accepts_cargo)) return;
/* Cargo is accepted, add industry to nearby stations nearby industry list. */
for (Station *st : ind->stations_near) {
st->industries_near.insert(ind);
}
ForAllStationsAroundTiles(ind->location, [ind](Station *st, TileIndex tile) {
if (!IsTileType(tile, MP_INDUSTRY) || GetIndustryIndex(tile) != ind->index) return false;
ind->stations_near.insert(st);
st->AddIndustryToDeliver(ind);
return true;
});
}
/**