Changeset - r3478:523ece58cb16
[Not reviewed]
master
0 1 0
tron - 18 years ago 2006-04-08 13:32:38
tron@openttd.org
(svn r4323) -Regression: Clear the slot assignments of all vehicles heading twoards a road stop if that road stop gets removed
This issue was fixed in r2210 and reintroduced in r4259 when the multistop handling was overhauled.
1 file changed with 12 insertions and 0 deletions:
0 comments (0 inline, 0 general)
station_cmd.c
Show inline comments
 
@@ -1407,12 +1407,24 @@ static int32 RemoveRoadStop(Station *st,
 

	
 
	assert(cur_stop != NULL);
 

	
 
	if (!EnsureNoVehicle(tile)) return CMD_ERROR;
 

	
 
	if (flags & DC_EXEC) {
 
		Vehicle* v;
 

	
 
		/* Clear the slot assignment of all vehicles heading for this road stop */
 
		if (cur_stop->num_vehicles != 0) {
 
			FOR_ALL_VEHICLES(v) {
 
				if (v->type == VEH_Road && v->u.road.slot == cur_stop) {
 
					ClearSlot(v);
 
				}
 
			}
 
		}
 
		assert(cur_stop->num_vehicles == 0);
 

	
 
		DoClearSquare(tile);
 

	
 
		cur_stop->used = false;
 
		if (cur_stop->prev != NULL) cur_stop->prev->next = cur_stop->next;
 
		if (cur_stop->next != NULL) cur_stop->next->prev = cur_stop->prev;
 

	
0 comments (0 inline, 0 general)