Exclude virtual trains from various vehicle list iterations

This commit is contained in:
Jonathan G Rennison
2019-05-27 17:56:41 +01:00
parent 3c2ebc4588
commit 96f000226e
9 changed files with 17 additions and 14 deletions

View File

@@ -2499,7 +2499,7 @@ static int WhoCanServiceIndustry(Industry *ind)
/* Check whether it accepts the right kind of cargo */
bool c_accepts = false;
bool c_produces = false;
if (v->type == VEH_TRAIN && v->IsFrontEngine()) {
if (v->type == VEH_TRAIN && v->IsFrontEngine() && !HasBit(v->subtype, GVSF_VIRTUAL)) {
for (const Vehicle *u = v; u != nullptr; u = u->Next()) {
CanCargoServiceIndustry(u->cargo_type, ind, &c_accepts, &c_produces);
}