summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2008-04-19 17:47:56 +0000
committerbjarni <bjarni@openttd.org>2008-04-19 17:47:56 +0000
commit01549e1574b8c4deeb28bf5127bc5027d58841d1 (patch)
tree2b75a2af1937bbe8c4a43d4b0bb8e42b40fa57b2 /src/vehicle.cpp
parentad3ef0fb26c5cf32228480a2d14510f27f1939af (diff)
downloadopenttd-01549e1574b8c4deeb28bf5127bc5027d58841d1.tar.xz
(svn r12792) -Codechange: [autoreplace] added a function to figure out if a replacement is needed and if so, to which EngineID
It's designed to save a bit of CPU time, specially if the replacement isn't buildable (think autorenew of old vehicle)
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 028ae5351..a4515f923 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -106,6 +106,7 @@ bool Vehicle::NeedsAutorenewing(const Player *p) const
if (!p->engine_renew) return false;
if (this->age - this->max_age < (p->engine_renew_months * 30)) return false;
+ if (this->age == 0) return false; // rail cars don't age and lacks a max age
return true;
}