diff options
author | tron <tron@openttd.org> | 2005-04-10 20:48:43 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-04-10 20:48:43 +0000 |
commit | 8b1d33492773b0c5fc035d83d84ec8c39b3fa71f (patch) | |
tree | 0b9795bf5a711b84874c3d53d1a3ffa9094357c4 | |
parent | 88a0e06cfc4a70925c1ac90216dae820d56d3e71 (diff) | |
download | openttd-8b1d33492773b0c5fc035d83d84ec8c39b3fa71f.tar.xz |
(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)
-rw-r--r-- | station_cmd.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/station_cmd.c b/station_cmd.c index 06745044d..e6f65385c 100644 --- a/station_cmd.c +++ b/station_cmd.c @@ -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]); - - 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; + const Vehicle *v = GetVehicle(rs->slot[k]); + + 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; } } |