diff options
author | smatz <smatz@openttd.org> | 2008-02-20 17:06:58 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-02-20 17:06:58 +0000 |
commit | a190606f2e7567898b71c663989cd47bed7eab91 (patch) | |
tree | a0fa27513f3db7b29c7cab369a56629ef6c457ce /src/train_cmd.cpp | |
parent | e95a85315ce8aeb40b1dd28cf6f5607032be9a7b (diff) | |
download | openttd-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.cpp | 4 |
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, |