summaryrefslogtreecommitdiff
path: root/roadveh_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-10-23 13:04:44 +0000
committertron <tron@openttd.org>2005-10-23 13:04:44 +0000
commit181d586a7c13a296a1b9355e15e55dda7ac0fcb2 (patch)
tree7a8d1fbbe0d0d6ee2c8e981c57be6a9003505e97 /roadveh_cmd.c
parent0b936c3222b3945f738885c6c7db3b46363ec6fe (diff)
downloadopenttd-181d586a7c13a296a1b9355e15e55dda7ac0fcb2.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.c11
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))