From 419f6e099f3b32a8b1f988dd7c912754589bf6d5 Mon Sep 17 00:00:00 2001 From: smatz Date: Fri, 26 Dec 2008 18:01:15 +0000 Subject: (svn r14743) -Codechange: use INVALID_TILE to indicate station doesn't have queried facility (or station/roadstop is invalid) instead of 0 (Yexo) --- src/order_cmd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/order_cmd.cpp') diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index f0806f607..e53630092 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1377,13 +1377,13 @@ static TileIndex GetStationTileForVehicle(const Vehicle* v, const Station* st) switch (v->type) { default: NOT_REACHED(); case VEH_TRAIN: return st->train_tile; - case VEH_AIRCRAFT: return CanAircraftUseStation(v->engine_type, st) ? st->airport_tile : 0; + case VEH_AIRCRAFT: return CanAircraftUseStation(v->engine_type, st) ? st->airport_tile : INVALID_TILE; case VEH_SHIP: return st->dock_tile; case VEH_ROAD: if (IsCargoInClass(v->cargo_type, CC_PASSENGERS)) { - return (st->bus_stops != NULL) ? st->bus_stops->xy : 0; + return (st->bus_stops != NULL) ? st->bus_stops->xy : INVALID_TILE; } else { - return (st->truck_stops != NULL) ? st->truck_stops->xy : 0; + return (st->truck_stops != NULL) ? st->truck_stops->xy : INVALID_TILE; } } } @@ -1430,7 +1430,7 @@ void CheckOrders(const Vehicle* v) TileIndex required_tile = GetStationTileForVehicle(v, st); n_st++; - if (required_tile == 0) problem_type = 3; + if (required_tile == INVALID_TILE) problem_type = 3; } } @@ -1763,7 +1763,7 @@ bool ProcessOrders(Vehicle *v) /* If it is unchanged, keep it. */ if (order->Equals(v->current_order) && (v->type == VEH_AIRCRAFT || v->dest_tile != 0) && - (v->type != VEH_SHIP || !order->IsType(OT_GOTO_STATION) || GetStation(order->GetDestination())->dock_tile != 0)) { + (v->type != VEH_SHIP || !order->IsType(OT_GOTO_STATION) || GetStation(order->GetDestination())->dock_tile != INVALID_TILE)) { return false; } -- cgit v1.2.3-70-g09d2