summaryrefslogtreecommitdiff
path: root/src/ai/default/default.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
commit9bdb194b2a94c60e54e1a8dac4b984a9f8d25914 (patch)
treea0fa27513f3db7b29c7cab369a56629ef6c457ce /src/ai/default/default.cpp
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/ai/default/default.cpp')
-rw-r--r--src/ai/default/default.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index 438ec6621..1c83d4edf 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -112,8 +112,8 @@ static void AiStateVehLoop(Player *p)
/* not profitable? */
if (v->age >= 730 &&
- v->profit_last_year >> 8 < _price.station_value * 5 &&
- v->profit_this_year >> 8 < _price.station_value * 5) {
+ v->profit_last_year < _price.station_value * 5 * 256 &&
+ v->profit_this_year < _price.station_value * 5 * 256) {
_players_ai[p->index].state_counter = 0;
_players_ai[p->index].state = AIS_SELL_VEHICLE;
_players_ai[p->index].cur_veh = v;