diff options
author | rubidium <rubidium@openttd.org> | 2007-02-13 22:27:27 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-02-13 22:27:27 +0000 |
commit | 154dff98736a2d1cdc30b7c380eebbe88479733a (patch) | |
tree | 685d32ae2e7c4960e0112a9916ef92abe04b4953 /src/station_cmd.cpp | |
parent | 86a4b5e1694cb74554cb119bfba65c5f7a6c0c48 (diff) | |
download | openttd-154dff98736a2d1cdc30b7c380eebbe88479733a.tar.xz |
(svn r8715) -Codechange/cleanup: replace magic numbers related to state of road vehicles with enums. Original patch by mart3p.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 5ab33781e..8698a8bbb 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2222,7 +2222,7 @@ static uint32 VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y) } } } else if (v->type == VEH_Road) { - if (v->u.road.state < 16 && !HASBIT(v->u.road.state, 2) && v->u.road.frame == 0) { + if (v->u.road.state < RVSB_IN_ROAD_STOP && v->u.road.frame == 0) { if (IsRoadStop(tile)) { /* Attempt to allocate a parking bay in a road stop */ RoadStop *rs = GetRoadStopByTile(tile, GetRoadStopType(tile)); @@ -2230,11 +2230,11 @@ static uint32 VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y) /* Check if station is busy or if there are no free bays. */ if (rs->IsEntranceBusy() || !rs->HasFreeBay()) return VETSB_CANNOT_ENTER; - v->u.road.state += 32; + SETBIT(v->u.road.state, RVS_IN_ROAD_STOP); /* Allocate a bay and update the road state */ uint bay_nr = rs->AllocateBay(); - SB(v->u.road.state, 1, 1, bay_nr); + SB(v->u.road.state, RVS_USING_SECOND_BAY, 1, bay_nr); /* Mark the station entrace as busy */ rs->SetEntranceBusy(true); |