Fix crash when road vehicle changed length in drive-through road stop

Due to refit and incorrectly implemented NewGRF
This commit is contained in:
Jonathan G Rennison
2024-02-09 18:21:51 +00:00
parent cfebbfac8c
commit 130d9cb650
2 changed files with 16 additions and 0 deletions

View File

@@ -60,6 +60,14 @@ struct RoadStop : RoadStopPool::PoolItem<&_roadstop_pool> {
return this->occupied;
}
/**
* Adjust the occupation of this road stop, only to handle vehicles unexpectedly changing length
*/
inline void AdjustOccupation(int adjustment)
{
this->occupied += adjustment;
}
void Leave(const RoadVehicle *rv);
void Enter(const RoadVehicle *rv);
void CheckIntegrity(const RoadStop *rs) const;