@@ -621,13 +621,13 @@ CommandCost CmdAutoreplaceVehicle(TileIn
if (free_wagon && IsFrontEngine(v->First())) return CMD_ERROR;
} else {
if (!v->IsPrimaryVehicle()) return CMD_ERROR;
}
const Company *c = GetCompany(_current_company);
bool wagon_removal = c->renew_keep_length;
bool wagon_removal = c->settings.renew_keep_length;
/* Test whether any replacement is set, before issuing a whole lot of commands that would end in nothing changed */
Vehicle *w = v;
bool any_replacements = false;
while (w != NULL && !any_replacements) {
any_replacements = (GetNewEngineType(w, c) != INVALID_ENGINE);