From 181d586a7c13a296a1b9355e15e55dda7ac0fcb2 Mon Sep 17 00:00:00 2001 From: tron Date: Sun, 23 Oct 2005 13:04:44 +0000 Subject: (svn r3078) Some more stuff, which piled up: - const, whitespace, indentation, bracing, GB/SB, pointless casts - use the trinary operator where appropriate - data types (uint[] -> AcceptedCargo, ...) - if cascade -> switch - if (ptr) -> if (ptr != NULL) - DeMorgan's Law - Fix some comments - 0 -> '\0', change magic numbers to symbolic constants --- roadveh_cmd.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'roadveh_cmd.c') diff --git a/roadveh_cmd.c b/roadveh_cmd.c index 9a5cc09f3..73887f6a2 100644 --- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -300,7 +300,7 @@ static Depot *FindClosestRoadDepot(Vehicle *v) TileIndex tile = v->tile; int i; - if (v->u.road.state == 255) { tile = GetVehicleOutOfTunnelTile(v); } + if (v->u.road.state == 255) tile = GetVehicleOutOfTunnelTile(v); if (_patches.new_pathfinding_all) { NPFFoundTargetData ftd; @@ -1034,13 +1034,14 @@ static int RoadFindPathToDest(Vehicle *v, TileIndex tile, int enterdir) } if (IsTileType(tile, MP_STREET)) { - if (GB(_m[tile].m5, 4, 4) == 2 && IsTileOwner(tile, v->owner)) - /* Road crossing */ - bitmask |= _road_veh_fp_ax_or[_m[tile].m5&3]; + if (GB(_m[tile].m5, 4, 4) == 2 && IsTileOwner(tile, v->owner)) { + /* Road depot */ + bitmask |= _road_veh_fp_ax_or[GB(_m[tile].m5, 0, 2)]; + } } else if (IsTileType(tile, MP_STATION)) { if (IsTileOwner(tile, OWNER_NONE) || IsTileOwner(tile, v->owner)) { /* Our station */ - Station *st = GetStation(_m[tile].m2); + const Station* st = GetStation(_m[tile].m2); byte val = _m[tile].m5; if (v->cargo_type != CT_PASSENGERS) { if (IS_BYTE_INSIDE(val, 0x43, 0x47) && (_patches.roadveh_queue || st->truck_stops->status&3)) -- cgit v1.2.3-54-g00ecf