(svn r3213) - Codechange: Clean up handling of road stops, avoiding unnecessary use of pointers and using the *BIT() macros.

This commit is contained in:
2005-11-17 10:12:21 +00:00
parent 754d26407e
commit 3e702afc08
2 changed files with 19 additions and 31 deletions

View File

@@ -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)