diff options
author | tron <tron@openttd.org> | 2005-10-23 13:04:44 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-10-23 13:04:44 +0000 |
commit | 47137cefb72d3b3d3bc6fdefc7a4b103429f6d46 (patch) | |
tree | 7a8d1fbbe0d0d6ee2c8e981c57be6a9003505e97 /roadveh_cmd.c | |
parent | 2cc2154ad26b96b032df2f4fca0ce1634e6330b2 (diff) | |
download | openttd-47137cefb72d3b3d3bc6fdefc7a4b103429f6d46.tar.xz |
(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
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r-- | roadveh_cmd.c | 11 |
1 files changed, 6 insertions, 5 deletions
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)) |