summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
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
commita190606f2e7567898b71c663989cd47bed7eab91 (patch)
treea0fa27513f3db7b29c7cab369a56629ef6c457ce /src/train_cmd.cpp
parente95a85315ce8aeb40b1dd28cf6f5607032be9a7b (diff)
downloadopenttd-a190606f2e7567898b71c663989cd47bed7eab91.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/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 9e3c70e08..2bd318983 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3689,8 +3689,8 @@ void TrainsYearlyLoop()
FOR_ALL_VEHICLES(v) {
if (v->type == VEH_TRAIN && IsFrontEngine(v)) {
/* show warning if train is not generating enough income last 2 years (corresponds to a red icon in the vehicle list) */
- if (_patches.train_income_warn && v->owner == _local_player && v->age >= 730 && v->profit_this_year < 0) {
- SetDParam(1, v->profit_this_year);
+ if (_patches.train_income_warn && v->owner == _local_player && v->age >= 730 && v->GetDisplayProfitThisYear() < 0) {
+ SetDParam(1, v->GetDisplayProfitThisYear());
SetDParam(0, v->unitnumber);
AddNewsItem(
STR_TRAIN_IS_UNPROFITABLE,