TBTR: Fix incorrect train not buildable warning with articulated units

This commit is contained in:
Jonathan G Rennison
2019-12-17 17:04:24 +00:00
parent 450df232ff
commit 4e310567fe
2 changed files with 2 additions and 2 deletions

View File

@@ -306,7 +306,7 @@ public:
int y = 4 - this->vscroll->GetPosition();
bool buildable = true;
for (Train *train = this->virtual_train; train != nullptr; train = train->Next()) {
for (Train *train = this->virtual_train; train != nullptr; train = train->GetNextUnit()) {
if (!IsEngineBuildable(train->engine_type, VEH_TRAIN, train->owner)) buildable = false;
}
if (!buildable) {

View File

@@ -656,7 +656,7 @@ public:
}
bool buildable = true;
for (const TemplateVehicle *u = v; u != nullptr; u = u->Next()) {
for (const TemplateVehicle *u = v; u != nullptr; u = u->GetNextUnit()) {
if (!IsEngineBuildable(u->engine_type, VEH_TRAIN, u->owner)) {
buildable = false;
break;