summaryrefslogtreecommitdiff
path: root/roadveh_cmd.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2005-11-17 10:12:21 +0000
committerpeter1138 <peter1138@openttd.org>2005-11-17 10:12:21 +0000
commit2a9d325930eb0d17f9e019b7b56299d9c28e7a4b (patch)
treecdeb753e43ef3784d9c21d6f5d98a687fac9040d /roadveh_cmd.c
parent479a9c2e47358cd5cb040e89c66a4de11d1b457d (diff)
downloadopenttd-2a9d325930eb0d17f9e019b7b56299d9c28e7a4b.tar.xz
(svn r3213) - Codechange: Clean up handling of road stops, avoiding unnecessary use of pointers and using the *BIT() macros.
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)