summaryrefslogtreecommitdiff
path: root/src/vehicle_base.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-02-20 17:06:58 +0000
committersmatz <smatz@openttd.org>2008-02-20 17:06:58 +0000
commit9bdb194b2a94c60e54e1a8dac4b984a9f8d25914 (patch)
treea0fa27513f3db7b29c7cab369a56629ef6c457ce /src/vehicle_base.h
parent2657090b1fc3123140ffd81f36f2d47270b3ae7c (diff)
downloadopenttd-9bdb194b2a94c60e54e1a8dac4b984a9f8d25914.tar.xz
(svn r12197) -Fix [FS#1788](r12134): show correct last year profit when the train had negative income
-Codechange: use GetDisplayProfitThisYear() to convert vehicle profit to readable form
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r--src/vehicle_base.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h
index 8d9c015d4..428398d6c 100644
--- a/src/vehicle_base.h
+++ b/src/vehicle_base.h
@@ -438,6 +438,18 @@ public:
Money GetDisplayRunningCost() const { return (this->GetRunningCost() >> 8); }
/**
+ * Gets the profit vehicle had this year. It can be sent into SetDParam for string processing.
+ * @return the vehicle's profit this year
+ */
+ Money GetDisplayProfitThisYear() const { return (this->profit_this_year >> 8); }
+
+ /**
+ * Gets the profit vehicle had last year. It can be sent into SetDParam for string processing.
+ * @return the vehicle's profit last year
+ */
+ Money GetDisplayProfitLastYear() const { return (this->profit_last_year >> 8); }
+
+ /**
* Set the next vehicle of this vehicle.
* @param next the next vehicle. NULL removes the next vehicle.
*/