diff options
author | celestar <celestar@openttd.org> | 2006-03-24 15:24:16 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2006-03-24 15:24:16 +0000 |
commit | 842eac5d7fb8c5408f75797f243876dc20a1454e (patch) | |
tree | 3b4d33841e65351365a09bb79e14272d518bca1b /train_cmd.c | |
parent | 0977a8a04e9c28d714a6b599d19bc8006f39ca03 (diff) | |
download | openttd-842eac5d7fb8c5408f75797f243876dc20a1454e.tar.xz |
(svn r4088) -Codechange: Introduce {Unb,B}arCrossing and IsCrossingBarred to put and get the status of a level crossing
Diffstat (limited to 'train_cmd.c')
-rw-r--r-- | train_cmd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/train_cmd.c b/train_cmd.c index e9c58bae9..354b86aea 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -1482,8 +1482,8 @@ static void DisableTrainCrossing(TileIndex tile) if (IsTileType(tile, MP_STREET) && IsLevelCrossing(tile) && VehicleFromPos(tile, &tile, TestTrainOnCrossing) == NULL && // empty? - GB(_m[tile].m5, 2, 1) != 0) { // Lights on? - SB(_m[tile].m5, 2, 1, 0); // Switch lights off + IsCrossingBarred(tile)) { + UnbarCrossing(tile); MarkTileDirtyByTile(tile); } } @@ -3206,8 +3206,8 @@ static bool TrainCheckIfLineEnds(Vehicle *v) if ((ts &= (ts >> 16)) == 0) { // make a rail/road crossing red if (IsTileType(tile, MP_STREET) && IsLevelCrossing(tile)) { - if (GB(_m[tile].m5, 2, 1) == 0) { - SB(_m[tile].m5, 2, 1, 1); + if (!IsCrossingBarred(tile)) { + BarCrossing(tile); SndPlayVehicleFx(SND_0E_LEVEL_CROSSING, v); MarkTileDirtyByTile(tile); } |