(svn r1568) made an enum of train subtypes to make the code more readable

This commit is contained in:
bjarni
2005-01-19 19:15:03 +00:00
parent e4a3d284b2
commit 2fd3553d78
12 changed files with 73 additions and 68 deletions

View File

@@ -1413,7 +1413,7 @@ static uint32 VehicleEnter_TunnelBridge(Vehicle *v, uint tile, int x, int y)
vdir = v->direction >> 1;
if (v->u.rail.track != 0x40 && dir == vdir) {
if (v->subtype == 0 && fc == _tunnel_fractcoord_1[dir]) {
if (v->subtype == TS_Front_Engine && fc == _tunnel_fractcoord_1[dir]) {
if (v->spritenum < 4)
SndPlayVehicleFx(SND_05_TRAIN_THROUGH_TUNNEL, v);
return 0;
@@ -1465,7 +1465,7 @@ static uint32 VehicleEnter_TunnelBridge(Vehicle *v, uint tile, int x, int y)
}
}
} else if (_map5[tile] & 0x80) {
if (v->type == VEH_Road || (v->type == VEH_Train && v->subtype == 0)) {
if (v->type == VEH_Road || (v->type == VEH_Train && v->subtype == TS_Front_Engine)) {
if (GetTileSlope(tile, &h) != 0)
h += 8; // Compensate for possible foundation
if (!(_map5[tile] & 0x40) || // start/end tile of bridge