summaryrefslogtreecommitdiff
path: root/src/ai/default
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-02-13 19:24:40 +0000
committersmatz <smatz@openttd.org>2008-02-13 19:24:40 +0000
commita0ddc43e92c33436bccc0d16ae935237e02a357e (patch)
treeaf07b8c3ed3437ba91111379ab438956940c60bb /src/ai/default
parentb7cd7919883ebec71a0e8ac88beb4bf72312e0d2 (diff)
downloadopenttd-a0ddc43e92c33436bccc0d16ae935237e02a357e.tar.xz
(svn r12134) -Change: count the number of ticks a vehicle was running this day to calculate running cost
-Fix [FS#1739]: vehicle profit is now counted with 8bit fract, so it is now shown properly in the vehicle details window
Diffstat (limited to 'src/ai/default')
-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 7bddaa2cb..95fab9619 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 < _price.station_value * 5 &&
- v->profit_this_year < _price.station_value * 5) {
+ v->profit_last_year >> 8 < _price.station_value * 5 &&
+ v->profit_this_year >> 8 < _price.station_value * 5) {
_players_ai[p->index].state_counter = 0;
_players_ai[p->index].state = AIS_SELL_VEHICLE;
_players_ai[p->index].cur_veh = v;