Merge branch 'master' into jgrpp
# Conflicts: # src/industry_cmd.cpp # src/station_cmd.cpp # src/station_func.h
This commit is contained in:
@@ -1707,20 +1707,12 @@ static void PopulateStationsNearby(Industry *ind)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get our list of nearby stations. */
|
||||
FindStationsAroundTiles(ind->location, &ind->stations_near, false, ind->index);
|
||||
|
||||
/* 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;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user