summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-08-27 08:41:36 +0000
committerfrosch <frosch@openttd.org>2011-08-27 08:41:36 +0000
commitb642b4a881ef645842242d389ff90a1d8cfc7e61 (patch)
tree89129404077b303461f91084809d0ad24df51ed9 /src
parent4c434ad775d64e1969352ff65c49b868d18c716d (diff)
downloadopenttd-b642b4a881ef645842242d389ff90a1d8cfc7e61.tar.xz
(svn r22847) -Fix (r22816): Wagons shall not be processed by autorenew.
Diffstat (limited to 'src')
-rw-r--r--src/vehicle.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 4aa24f546..890ecf6bc 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -81,7 +81,9 @@ bool Vehicle::NeedsAutorenewing(const Company *c) const
if (!c->settings.engine_renew) return false;
if (this->age - this->max_age < (c->settings.engine_renew_months * 30)) return false;
- if (this->age == 0) return false; // rail cars don't age and lacks a max age
+
+ /* Only engines need renewing */
+ if (this->type == VEH_TRAIN && !Train::From(this)->IsEngine()) return false;
return true;
}