Add debug console command to unblock bay road stops with incorrect occupancy state

This commit is contained in:
Jonathan G Rennison
2024-02-21 23:04:41 +00:00
parent 16d77d9268
commit ea0fa2194a
3 changed files with 44 additions and 0 deletions

View File

@@ -370,6 +370,21 @@ bool RoadStop::Enter(RoadVehicle *rv)
}
}
void RoadStop::DebugClearOccupancy()
{
SetBit(this->status, RSSFB_BAY0_FREE);
SetBit(this->status, RSSFB_BAY1_FREE);
ClrBit(this->status, RSSFB_ENTRY_BUSY);
}
void RoadStop::DebugReEnter(const RoadVehicle *rv)
{
if (!IsInsideMM(rv->state, RVSB_IN_ROAD_STOP, RVSB_IN_ROAD_STOP_END)) return;
ClrBit(this->status, HasBit(rv->state, RVS_USING_SECOND_BAY) ? RSSFB_BAY1_FREE : RSSFB_BAY0_FREE);
if (!HasBit(rv->state, RVS_ENTERED_STOP)) SetBit(this->status, RSSFB_ENTRY_BUSY);
}
/**
* Leave the road stop
* @param rv the vehicle that leaves the stop