From 3e702afc08bd8118f5b01e6493fcdea1aea4c0d4 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Thu, 17 Nov 2005 10:12:21 +0000 Subject: (svn r3213) - Codechange: Clean up handling of road stops, avoiding unnecessary use of pointers and using the *BIT() macros. --- roadveh_cmd.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'roadveh_cmd.c') 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) -- cgit v1.2.3-54-g00ecf