(svn r3564) Several smaller changes:

- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
This commit is contained in:
tron
2006-02-06 09:18:04 +00:00
parent 0755bbead0
commit 453b30e387
23 changed files with 218 additions and 212 deletions

View File

@@ -1466,12 +1466,12 @@ static const byte _tunnel_fractcoord_7[4] = {0x52, 0x85, 0x96, 0x49};
static uint32 VehicleEnter_TunnelBridge(Vehicle *v, TileIndex tile, int x, int y)
{
int z;
int dir, vdir;
byte fc;
if (GB(_m[tile].m5, 4, 4) == 0) {
z = GetSlopeZ(x, y) - v->z_pos;
int z = GetSlopeZ(x, y) - v->z_pos;
byte fc;
if (myabs(z) > 2) return 8;
if (v->type == VEH_Train) {