diff options
author | rubidium <rubidium@openttd.org> | 2008-04-06 07:48:51 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-04-06 07:48:51 +0000 |
commit | d6623cf6541af8cb27359b59b97cb9e47f61bd0e (patch) | |
tree | bf63686bb4da660cbcdc1074a869b5b86df60166 /src/ai | |
parent | 8cd1795fe32fc2afaa75f48b8b62ff992bf8f618 (diff) | |
download | openttd-d6623cf6541af8cb27359b59b97cb9e47f61bd0e.tar.xz |
(svn r12588) -Codechange: do not access the destination of an order directly.
Diffstat (limited to 'src/ai')
-rw-r--r-- | src/ai/default/default.cpp | 6 | ||||
-rw-r--r-- | src/ai/trolly/trolly.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp index 9436fd6ae..2408674af 100644 --- a/src/ai/default/default.cpp +++ b/src/ai/default/default.cpp @@ -263,8 +263,8 @@ static EngineID AiChooseAircraftToReplaceWith(const Player* p, const Vehicle* v) FOR_VEHICLE_ORDERS(v, o) { if (!o->IsValid()) continue; - if (!IsValidStationID(o->dest)) continue; - const Station *st = GetStation(o->dest); + if (!IsValidStationID(o->GetDestination())) continue; + const Station *st = GetStation(o->GetDestination()); if (!(st->facilities & FACIL_AIRPORT)) continue; AirportFTAClass::Flags flags = st->Airport()->flags; @@ -3662,7 +3662,7 @@ static void AiStateRemoveStation(Player *p) byte *in_use = MallocT<byte>(GetMaxStationIndex() + 1); memset(in_use, 0, GetMaxStationIndex() + 1); FOR_ALL_ORDERS(ord) { - if (ord->IsType(OT_GOTO_STATION)) in_use[ord->dest] = 1; + if (ord->IsType(OT_GOTO_STATION)) in_use[ord->GetDestination()] = 1; } // Go through all stations and delete those that aren't in use diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp index 2876d240e..46aa0f10d 100644 --- a/src/ai/trolly/trolly.cpp +++ b/src/ai/trolly/trolly.cpp @@ -553,7 +553,7 @@ static bool AiNew_CheckVehicleStation(Player *p, Station *st) const Order *order; FOR_VEHICLE_ORDERS(v, order) { - if (order->IsType(OT_GOTO_STATION) && GetStation(order->dest) == st) { + if (order->IsType(OT_GOTO_STATION) && GetStation(order->GetDestination()) == st) { // This vehicle has this city in its list count++; } |