TBTR: Fix incorrect train not buildable warning with articulated units

pull/128/head
Jonathan G Rennison 5 years ago
parent 450df232ff
commit 4e310567fe

@ -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) {

@ -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;

Loading…
Cancel
Save