station_cmd.c
changeset 3478 ff1ee5617a58
parent 3475 150d89779e96
child 3479 3655a074a380
equal deleted inserted replaced
3477:4a686a43af8a 3478:ff1ee5617a58
  1408 	assert(cur_stop != NULL);
  1408 	assert(cur_stop != NULL);
  1409 
  1409 
  1410 	if (!EnsureNoVehicle(tile)) return CMD_ERROR;
  1410 	if (!EnsureNoVehicle(tile)) return CMD_ERROR;
  1411 
  1411 
  1412 	if (flags & DC_EXEC) {
  1412 	if (flags & DC_EXEC) {
       
  1413 		Vehicle* v;
       
  1414 
       
  1415 		/* Clear the slot assignment of all vehicles heading for this road stop */
       
  1416 		if (cur_stop->num_vehicles != 0) {
       
  1417 			FOR_ALL_VEHICLES(v) {
       
  1418 				if (v->type == VEH_Road && v->u.road.slot == cur_stop) {
       
  1419 					ClearSlot(v);
       
  1420 				}
       
  1421 			}
       
  1422 		}
       
  1423 		assert(cur_stop->num_vehicles == 0);
       
  1424 
  1413 		DoClearSquare(tile);
  1425 		DoClearSquare(tile);
  1414 
  1426 
  1415 		cur_stop->used = false;
  1427 		cur_stop->used = false;
  1416 		if (cur_stop->prev != NULL) cur_stop->prev->next = cur_stop->next;
  1428 		if (cur_stop->prev != NULL) cur_stop->prev->next = cur_stop->next;
  1417 		if (cur_stop->next != NULL) cur_stop->next->prev = cur_stop->prev;
  1429 		if (cur_stop->next != NULL) cur_stop->next->prev = cur_stop->prev;