(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
This commit is contained in:
tron
2005-10-23 13:04:44 +00:00
parent 2cc2154ad2
commit 47137cefb7
38 changed files with 442 additions and 453 deletions

View File

@@ -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))