Changeset - r1706:eada95693a77
[Not reviewed]
master
0 1 0
Darkvater - 20 years ago 2005-04-16 20:10:24
darkvater@openttd.org
(svn r2210) - Fix: When a road-station is deleted, also delete the assigned slots of all vehicles headed to that station. This fixes an assertion, thanks go to Tron for finding the cause.
1 file changed with 9 insertions and 0 deletions:
0 comments (0 inline, 0 general)
station_cmd.c
Show inline comments
 
@@ -1560,8 +1560,17 @@ static int32 RemoveRoadStop(Station *st,
 
		return CMD_ERROR;
 

	
 
	if (flags & DC_EXEC) {
 
		int i;
 
		DoClearSquare(tile);
 

	
 
		/* Clear all vehicles destined for this station */
 
		for (i = 0; i != NUM_SLOTS; i++) {
 
			if (cur_stop->slot[i] != INVALID_SLOT) {
 
				Vehicle *v = GetVehicle(cur_stop->slot[i]);
 
				ClearSlot(v, v->u.road.slot);
 
			}
 
		}
 

	
 
		cur_stop->used = false;
 
		if (cur_stop->prev != NULL)	//alter previous stop
 
			cur_stop->prev->next = cur_stop->next;
0 comments (0 inline, 0 general)