Fix deleting road vehicle in bay stop not unmarking as occupied
This commit is contained in:
@@ -536,9 +536,6 @@ static void DeleteLastRoadVeh(RoadVehicle *v)
|
|||||||
u->SetNext(nullptr);
|
u->SetNext(nullptr);
|
||||||
v->last_station_visited = first->last_station_visited; // for PreDestructor
|
v->last_station_visited = first->last_station_visited; // for PreDestructor
|
||||||
|
|
||||||
/* Only leave the road stop when we're really gone. */
|
|
||||||
if (IsInsideMM(v->state, RVSB_IN_ROAD_STOP, RVSB_IN_ROAD_STOP_END)) RoadStop::GetByTile(v->tile, GetRoadStopType(v->tile))->Leave(v);
|
|
||||||
|
|
||||||
delete v;
|
delete v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1202,8 +1202,8 @@ void Vehicle::PreDestructor()
|
|||||||
|
|
||||||
if (this->type == VEH_ROAD && this->IsPrimaryVehicle()) {
|
if (this->type == VEH_ROAD && this->IsPrimaryVehicle()) {
|
||||||
RoadVehicle *v = RoadVehicle::From(this);
|
RoadVehicle *v = RoadVehicle::From(this);
|
||||||
if (!(v->vehstatus & VS_CRASHED) && IsInsideMM(v->state, RVSB_IN_DT_ROAD_STOP, RVSB_IN_DT_ROAD_STOP_END)) {
|
if (IsInsideMM(v->state, RVSB_IN_DT_ROAD_STOP, RVSB_IN_DT_ROAD_STOP_END) || IsInsideMM(v->state, RVSB_IN_ROAD_STOP, RVSB_IN_ROAD_STOP_END)) {
|
||||||
/* Leave the drive through roadstop, when you have not already left it. */
|
/* Leave the roadstop (bay or drive-through), when you have not already left it. */
|
||||||
RoadStop::GetByTile(v->tile, GetRoadStopType(v->tile))->Leave(v);
|
RoadStop::GetByTile(v->tile, GetRoadStopType(v->tile))->Leave(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user