mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r2176) Revise CheckOprhanedSlot():
- Don't assert the vehicle type, as it can be anything - Don't touch the slot information of the vehicle, because it's possible that it is not a road vehicle anymore and even if it is, it has nothing to to with that slot - Trim the debug printout, because the information about the vehicle is arbitrary (Joint effort with Darkvater)
This commit is contained in:
parent
41f38775a1
commit
4dbf5b37cc
@ -2426,15 +2426,12 @@ static void CheckOrphanedSlots(const Station *st, RoadStopType rst)
|
||||
for (rs = GetPrimaryRoadStop(st, rst); rs != NULL; rs = rs->next) {
|
||||
for (k = 0; k < NUM_SLOTS; k++) {
|
||||
if (rs->slot[k] != INVALID_SLOT) {
|
||||
Vehicle *v = GetVehicle(rs->slot[k]);
|
||||
const Vehicle *v = GetVehicle(rs->slot[k]);
|
||||
|
||||
assert(v->type == VEH_Road);
|
||||
if (v->u.road.slot != rs) {
|
||||
DEBUG(ms, 1) ("Multistop: %s slot desync between stop at 0x%X of station %d "
|
||||
"and Vehicle %d at going to 0x%X! (don't panic)", (v->cargo_type == CT_PASSENGERS) ? "Bus" : "Truck",
|
||||
rs->xy, st->index, v->unitnumber, v->dest_tile);
|
||||
v->u.road.slot = NULL;
|
||||
v->u.road.slot_age = 0;
|
||||
if (v->type != VEH_Road || v->u.road.slot != rs) {
|
||||
DEBUG(ms, 0) (
|
||||
"Multistop: Orphaned %s slot at 0x%X of station %d (don't panic)",
|
||||
(rst == RS_BUS) ? "bus" : "truck", rs->xy, st->index);
|
||||
rs->slot[k] = INVALID_SLOT;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user