diff options
author | bjarni <bjarni@openttd.org> | 2008-02-23 22:01:55 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2008-02-23 22:01:55 +0000 |
commit | 973d1fd6ad97ad17a2b8e25e2059cc1faa933894 (patch) | |
tree | 749b019a5a21f0d18977297475fb38406c644ebf /src/aircraft_cmd.cpp | |
parent | 4e90a42f0c7635879b28aa7d28621f8c20fc025a (diff) | |
download | openttd-973d1fd6ad97ad17a2b8e25e2059cc1faa933894.tar.xz |
(svn r12230) -Codechange: [autoreplace] made a function to detect if a vehicle needs autorenewing
This will remove duplicated code and ensure that the check is consistent
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 81f2fc685..18ba5634c 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1574,7 +1574,7 @@ static inline bool CheckSendAircraftToHangarForReplacement(const Vehicle *v) /* There is no autoreplace assigned to this EngineID so we will set it to renew to the same type if needed */ new_engine = v->engine_type; - if(!p->engine_renew || (v->age - v->max_age) < p->engine_renew_months * 30) { + if (!v->NeedsAutorenewing(p)) { /* No need to replace the aircraft */ return false; } |