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
commit3e702afc08bd8118f5b01e6493fcdea1aea4c0d4 (patch)
treecdeb753e43ef3784d9c21d6f5d98a687fac9040d /roadveh_cmd.c
parent754d26407e8cda101f04c93a94c60bc0625f540c (diff)
downloadopenttd-3e702afc08bd8118f5b01e6493fcdea1aea4c0d4.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)