order_cmd.c
changeset 1217 ab9f02a224ab
parent 1111 2184bf930d25
child 1245 768d9bc95aaa
equal deleted inserted replaced
1216:ab4d046ee9d7 1217:ab9f02a224ab
   330 
   330 
   331 			v->cur_order_index = b;
   331 			v->cur_order_index = b;
   332 
   332 
   333 			if (v->type == VEH_Train)
   333 			if (v->type == VEH_Train)
   334 				v->u.rail.days_since_order_progr = 0;
   334 				v->u.rail.days_since_order_progr = 0;
       
   335 
       
   336 			if (v->type == VEH_Road && v->u.road.slot != NULL) {
       
   337 				//Clear the slot
       
   338 				v->u.road.slot->slot[v->u.road.slotindex] = 0;
       
   339 				v->u.road.slot = NULL;
       
   340 			}
   335 		}
   341 		}
   336 
   342 
   337 		/* NON-stop flag is misused to see if a train is in a station that is
   343 		/* NON-stop flag is misused to see if a train is in a station that is
   338 		    on his order list or not */
   344 		    on his order list or not */
   339 		if (v->current_order.type == OT_LOADING &&
   345 		if (v->current_order.type == OT_LOADING &&
   480 				TileIndex required_dst;
   486 				TileIndex required_dst;
   481 
   487 
   482 				FOR_VEHICLE_ORDERS(src, order) {
   488 				FOR_VEHICLE_ORDERS(src, order) {
   483 					if (order->type == OT_GOTO_STATION) {
   489 					if (order->type == OT_GOTO_STATION) {
   484 						const Station *st = GetStation(order->station);
   490 						const Station *st = GetStation(order->station);
   485 						required_dst = (dst->cargo_type == CT_PASSENGERS) ? st->bus_tile : st->lorry_tile;
   491 						required_dst = (dst->cargo_type == CT_PASSENGERS) ? st->bus_stops->xy : st->truck_stops->xy;
   486 						/* This station has not the correct road-bay, so we can't copy! */
   492 						/* This station has not the correct road-bay, so we can't copy! */
   487 						if (!required_dst)
   493 						if (!required_dst)
   488 							return CMD_ERROR;
   494 							return CMD_ERROR;
   489 					}
   495 					}
   490 				}
   496 				}