From 35fb17947a4432b32ebe0b035b744d63b4d3a146 Mon Sep 17 00:00:00 2001 From: tron Date: Tue, 21 Feb 2006 06:43:53 +0000 Subject: (svn r3643) Remove a local variable which is just a pointer to a road stop status field and had the sensible name 'b'; instead directly use the road stop status field --- roadveh_cmd.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'roadveh_cmd.c') diff --git a/roadveh_cmd.c b/roadveh_cmd.c index b81eee206..130bed239 100644 --- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -1294,11 +1294,10 @@ again: } if (IS_BYTE_INSIDE(_m[v->tile].m5, 0x43, 0x4B)) { RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile)); - byte *b = &rs->status; - //we have reached a loading bay, mark it as used - //and clear the usage bit (0x80) of the stop - *b = (*b | ((v->u.road.state&2)?2:1)) & ~0x80; + // reached a loading bay, mark it as used and clear the usage bit + SETBIT(rs->status, v->u.road.state & 2 ? 1 : 0); // occupied bay + CLRBIT(rs->status, 7); // usage bit } } @@ -1385,7 +1384,6 @@ again: if (v->u.road.state >= 0x20 && _road_veh_data_1[v->u.road.state - 0x20 + (_opt.road_side<<4)] == v->u.road.frame) { RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile)); - byte *b = &rs->status; st = GetStation(_m[v->tile].m2); @@ -1393,7 +1391,7 @@ again: v->current_order.type != OT_GOTO_DEPOT) { Order old_order; - *b &= ~0x80; + CLRBIT(rs->status, 7); v->last_station_visited = _m[v->tile].m2; @@ -1419,14 +1417,14 @@ again: } if (v->current_order.type != OT_GOTO_DEPOT) { - if (*b&0x80) { + if (HASBIT(rs->status, 7)) { v->cur_speed = 0; return; } v->current_order.type = OT_NOTHING; v->current_order.flags = 0; } - *b |= 0x80; + SETBIT(rs->status, 7); if (rs == v->u.road.slot) { //we have arrived at the correct station -- cgit v1.2.3-54-g00ecf