|
@@ -462,19 +462,13 @@ void RoadVehicle::UpdateDeltaXY(Directio
|
|
|
this->y_extent = GB(x, 24, 8);
|
|
|
this->z_extent = 6;
|
|
|
}
|
|
|
|
|
|
static void ClearCrashedStation(RoadVehicle *v)
|
|
|
{
|
|
|
RoadStop *rs = RoadStop::GetByTile(v->tile, GetRoadStopType(v->tile));
|
|
|
|
|
|
/* Mark the station entrance as not busy */
|
|
|
rs->SetEntranceBusy(false);
|
|
|
|
|
|
/* Free the parking bay */
|
|
|
rs->FreeBay(HasBit(v->state, RVS_USING_SECOND_BAY));
|
|
|
RoadStop::GetByTile(v->tile, GetRoadStopType(v->tile))->Leave(v);
|
|
|
}
|
|
|
|
|
|
static void DeleteLastRoadVeh(RoadVehicle *v)
|
|
|
{
|
|
|
Vehicle *u = v;
|
|
|
for (; v->Next() != NULL; v = v->Next()) u = v;
|
|
@@ -1314,23 +1308,13 @@ again:
|
|
|
if (IsReversingRoadTrackdir(dir) && IsInsideMM(v->state, RVSB_IN_ROAD_STOP, RVSB_IN_ROAD_STOP_END)) {
|
|
|
/* New direction is trying to turn vehicle around.
|
|
|
* We can't turn at the exit of a road stop so wait.*/
|
|
|
v->cur_speed = 0;
|
|
|
return false;
|
|
|
}
|
|
|
if (IsRoadStop(v->tile)) {
|
|
|
RoadStop *rs = RoadStop::GetByTile(v->tile, GetRoadStopType(v->tile));
|
|
|
|
|
|
/* Vehicle is leaving a road stop tile, mark bay as free
|
|
|
* For drive-through stops, only do it if the vehicle stopped here */
|
|
|
if (IsStandardRoadStopTile(v->tile) || HasBit(v->state, RVS_IS_STOPPING)) {
|
|
|
rs->FreeBay(HasBit(v->state, RVS_USING_SECOND_BAY));
|
|
|
ClrBit(v->state, RVS_IS_STOPPING);
|
|
|
}
|
|
|
if (IsStandardRoadStopTile(v->tile)) rs->SetEntranceBusy(false);
|
|
|
}
|
|
|
if (IsRoadStop(v->tile)) RoadStop::GetByTile(v->tile, GetRoadStopType(v->tile))->Leave(v);
|
|
|
}
|
|
|
|
|
|
if (!HasBit(r, VETS_ENTERED_WORMHOLE)) {
|
|
|
v->tile = tile;
|
|
|
v->state = (byte)dir;
|
|
|
v->frame = start_frame;
|