(svn r14801) -Codechange: don't reference Vehicle::num_orders directly but through a method GetNumOrders() (PhilSophus)

This commit is contained in:
rubidium
2009-01-03 13:20:32 +00:00
parent 18b27692aa
commit d428da5a35
7 changed files with 50 additions and 44 deletions

View File

@@ -1454,7 +1454,7 @@ CommandCost CmdSellRailWagon(TileIndex tile, uint32 flags, uint32 p1, uint32 p2,
/* Copy orders (by sharing) */
new_f->orders = first->orders;
new_f->num_orders = first->num_orders;
new_f->num_orders = first->GetNumOrders();
new_f->AddToShared(first);
DeleteVehicleOrders(first);
@@ -2360,7 +2360,7 @@ static void CheckNextTrainTile(Vehicle *v)
/* Exit if we are on a station tile and are going to stop. */
if (IsRailwayStationTile(v->tile) && v->current_order.ShouldStopAtStation(v, GetStationIndex(v->tile))) return;
/* Exit if the current order doesn't have a destination, but the train has orders. */
if ((v->current_order.IsType(OT_NOTHING) || v->current_order.IsType(OT_LEAVESTATION)) && v->num_orders > 0) return;
if ((v->current_order.IsType(OT_NOTHING) || v->current_order.IsType(OT_LEAVESTATION)) && v->GetNumOrders() > 0) return;
Trackdir td = GetVehicleTrackdir(v);
@@ -2853,7 +2853,7 @@ public:
do {
/* Wrap around. */
if (this->index >= this->v->num_orders) this->index = 0;
if (this->index >= this->v->GetNumOrders()) this->index = 0;
Order *order = GetVehicleOrder(this->v, this->index);
assert(order != NULL);