Fix double-leave of crashed road vehicle in drive-through stop

See: #662
This commit is contained in:
Jonathan G Rennison
2024-03-03 18:49:38 +00:00
parent c29a7128c6
commit 1c83ea8694
2 changed files with 2 additions and 1 deletions

View File

@@ -613,6 +613,7 @@ uint RoadVehicle::Crash(bool flooded)
/* If we're in a drive through road stop we ought to leave it */
if (IsInsideMM(this->state, RVSB_IN_DT_ROAD_STOP, RVSB_IN_DT_ROAD_STOP_END)) {
RoadStop::GetByTile(this->tile, GetRoadStopType(this->tile))->Leave(this);
this->state &= RVSB_ROAD_STOP_TRACKDIR_MASK;
}
}
this->crashed_ctr = flooded ? 2000 : 1; // max 2220, disappear pretty fast when flooded