summaryrefslogtreecommitdiff
path: root/src/ai/trolly/trolly.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-22 11:58:59 +0000
committerrubidium <rubidium@openttd.org>2007-06-22 11:58:59 +0000
commite5c352818d7edfdc5219e4c82f7d5b2083b2b72d (patch)
treefd6fbc96b8d23bef18ed7267fa8174e1689c8e78 /src/ai/trolly/trolly.cpp
parent6159f58948763ed39a457e6ff825a735eea06b23 (diff)
downloadopenttd-e5c352818d7edfdc5219e4c82f7d5b2083b2b72d.tar.xz
(svn r10266) -Codechange: keep track of the origin, time of travel and accumulated feeder share (transfers) of individual pieces of cargo. This means that cargo isn't thrown on a big pile when it's put in a station or unloaded at a station, however the GUI does not reflect these changes yet so you will not actually see it.
Diffstat (limited to 'src/ai/trolly/trolly.cpp')
-rw-r--r--src/ai/trolly/trolly.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp
index 1f540ceed..0b2beddac 100644
--- a/src/ai/trolly/trolly.cpp
+++ b/src/ai/trolly/trolly.cpp
@@ -617,7 +617,7 @@ static void AiNew_State_FindStation(Player *p)
if (p->ainew.tbt == AI_BUS && (FACIL_BUS_STOP & st->facilities) == FACIL_BUS_STOP) {
if (st->town == town) {
// Check how much cargo there is left in the station
- if ((st->goods[p->ainew.cargo].waiting_acceptance & 0xFFF) > RoadVehInfo(i)->capacity * AI_STATION_REUSE_MULTIPLER) {
+ if ((int)st->goods[p->ainew.cargo].cargo.Count() > RoadVehInfo(i)->capacity * AI_STATION_REUSE_MULTIPLER) {
if (AiNew_CheckVehicleStation(p, st)) {
// We did found a station that was good enough!
new_tile = st->xy;
@@ -1258,7 +1258,7 @@ static void AiNew_CheckVehicle(Player *p, Vehicle *v)
if (v->profit_last_year + v->profit_this_year < AI_MINIMUM_ROUTE_PROFIT ||
(v->reliability * 100 >> 16) < 40) {
// There is a possibility that the route is fucked up...
- if (v->cargo_days > AI_VEHICLE_LOST_DAYS) {
+ if (v->cargo.DaysInTransit() > AI_VEHICLE_LOST_DAYS) {
// The vehicle is lost.. check the route, or else, get the vehicle
// back to a depot
// TODO: make this piece of code