summaryrefslogtreecommitdiff
path: root/roadveh_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index c1d4dd4b0..87b52cfa5 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -463,21 +463,13 @@ static void UpdateRoadVehDeltaXY(Vehicle *v)
static void ClearCrashedStation(Vehicle *v)
{
- TileIndex tile = v->tile;
- byte *b, bb;
-
- RoadStop *rs = GetRoadStopByTile(tile, GetRoadStopType(tile));
- b = &rs->status;
-
- bb = *b;
+ RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile));
// mark station as not busy
- bb &= ~0x80;
+ CLRBIT(rs->status, 7);
// free parking bay
- bb |= (v->u.road.state&0x02)?2:1;
-
- *b = bb;
+ SETBIT(rs->status, HASBIT(v->u.road.state, 1) ? 1 : 0);
}
static void RoadVehDelete(Vehicle *v)