comparison src/station_cmd.cpp @ 8840:c3d2f0eb69a1 draft

(svn r12588) -Codechange: do not access the destination of an order directly.
author rubidium <rubidium@openttd.org>
date Sun, 06 Apr 2008 07:48:51 +0000
parents 890a77315801
children 838e1d6a0321
comparison
equal deleted inserted replaced
8839:ebb630745ebc 8840:c3d2f0eb69a1
1896 const Vehicle *v; 1896 const Vehicle *v;
1897 FOR_ALL_VEHICLES(v) { 1897 FOR_ALL_VEHICLES(v) {
1898 if (player == INVALID_PLAYER || v->owner == player) { 1898 if (player == INVALID_PLAYER || v->owner == player) {
1899 const Order *order; 1899 const Order *order;
1900 FOR_VEHICLE_ORDERS(v, order) { 1900 FOR_VEHICLE_ORDERS(v, order) {
1901 if (order->IsType(OT_GOTO_STATION) && order->dest == station) { 1901 if (order->IsType(OT_GOTO_STATION) && order->GetDestination() == station) {
1902 return true; 1902 return true;
1903 } 1903 }
1904 } 1904 }
1905 } 1905 }
1906 } 1906 }
2435 2435
2436 if (!rs->IsFreeBay(side)) return VETSB_CANNOT_ENTER; 2436 if (!rs->IsFreeBay(side)) return VETSB_CANNOT_ENTER;
2437 2437
2438 /* Check if the vehicle is stopping at this road stop */ 2438 /* Check if the vehicle is stopping at this road stop */
2439 if (GetRoadStopType(tile) == (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK) && 2439 if (GetRoadStopType(tile) == (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK) &&
2440 v->current_order.dest == GetStationIndex(tile)) { 2440 v->current_order.GetDestination() == GetStationIndex(tile)) {
2441 SetBit(v->u.road.state, RVS_IS_STOPPING); 2441 SetBit(v->u.road.state, RVS_IS_STOPPING);
2442 rs->AllocateDriveThroughBay(side); 2442 rs->AllocateDriveThroughBay(side);
2443 } 2443 }
2444 2444
2445 /* Indicate if vehicle is using second bay. */ 2445 /* Indicate if vehicle is using second bay. */