diff options
author | frosch <frosch@openttd.org> | 2008-08-16 14:02:20 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-08-16 14:02:20 +0000 |
commit | f7826f8a372d3120cc9d56e4d1c11df3e2fd577c (patch) | |
tree | 4c275596da6f577f47cea17f49ee3870846e07cb /src/vehicle_base.h | |
parent | 56459cab81f6a56d1fde29130670d001389ff7ce (diff) | |
download | openttd-f7826f8a372d3120cc9d56e4d1c11df3e2fd577c.tar.xz |
(svn r14083) -Fix [FS#1264, FS#2037, FS#2038, FS#2110]: Rewrite the autoreplace kernel.
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r-- | src/vehicle_base.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 440f30d1d..f7d646f9b 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -483,6 +483,29 @@ public: */ inline bool IsOrderListShared() const { return this->next_shared != NULL || this->prev_shared != NULL; }; + /** + * Copy certain configurations and statistics of a vehicle after successful autoreplace/renew + * The function shall copy everything that cannot be copied by a command (like orders / group etc), + * and that shall not be resetted for the new vehicle. + * @param src The old vehicle + */ + inline void CopyVehicleConfigAndStatistics(const Vehicle *src) + { + this->unitnumber = src->unitnumber; + + this->cur_order_index = src->cur_order_index; + this->current_order = src->current_order; + this->dest_tile = src->dest_tile; + + this->profit_this_year = src->profit_this_year; + this->profit_last_year = src->profit_last_year; + + this->current_order_time = src->current_order_time; + this->lateness_counter = src->lateness_counter; + + this->service_interval = src->service_interval; + } + bool NeedsAutorenewing(const Player *p) const; /** |