order_cmd.c
changeset 2805 b6098e7ca457
parent 2767 3282c77ffc27
child 2817 58dcead3f545
equal deleted inserted replaced
2804:b932fe148d36 2805:b6098e7ca457
   384 				if (cur < u->num_orders)
   384 				if (cur < u->num_orders)
   385 					u->cur_order_index = cur;
   385 					u->cur_order_index = cur;
   386 			}
   386 			}
   387 			/* Update any possible open window of the vehicle */
   387 			/* Update any possible open window of the vehicle */
   388 			InvalidateVehicleOrder(u);
   388 			InvalidateVehicleOrder(u);
   389 			if (u->type == VEH_Train) u->u.rail.shortest_platform[1] = 0; // we changed the orders so we invalidate the station length collector
       
   390 
   389 
   391 			u = u->next_shared;
   390 			u = u->next_shared;
   392 		}
   391 		}
   393 
   392 
   394 		/* Make sure to rebuild the whole list */
   393 		/* Make sure to rebuild the whole list */
   515 		/* NON-stop flag is misused to see if a train is in a station that is
   514 		/* NON-stop flag is misused to see if a train is in a station that is
   516 		 * on his order list or not */
   515 		 * on his order list or not */
   517 		if (v->current_order.type == OT_LOADING && HASBIT(v->current_order.flags, OFB_NON_STOP))
   516 		if (v->current_order.type == OT_LOADING && HASBIT(v->current_order.flags, OFB_NON_STOP))
   518 			v->current_order.flags = 0;
   517 			v->current_order.flags = 0;
   519 
   518 
   520 		if (v->type == VEH_Train) v->u.rail.shortest_platform[1] = 0; // we changed the orders so we invalidate the station length collector
       
   521 		InvalidateVehicleOrder(v);
   519 		InvalidateVehicleOrder(v);
   522 	}
   520 	}
   523 
   521 
   524 	/* We have an aircraft/ship, they have a mini-schedule, so update them all */
   522 	/* We have an aircraft/ship, they have a mini-schedule, so update them all */
   525 	if (v->type == VEH_Aircraft) InvalidateWindowClasses(WC_AIRCRAFT_LIST);
   523 	if (v->type == VEH_Aircraft) InvalidateWindowClasses(WC_AIRCRAFT_LIST);
   658 
   656 
   659 				InvalidateVehicleOrder(dst);
   657 				InvalidateVehicleOrder(dst);
   660 				InvalidateVehicleOrder(src);
   658 				InvalidateVehicleOrder(src);
   661 
   659 
   662 				RebuildVehicleLists();
   660 				RebuildVehicleLists();
   663 				if (dst->type == VEH_Train) dst->u.rail.shortest_platform[1] = 0; // we changed the orders so we invalidate the station length collector
       
   664 			}
   661 			}
   665 		} break;
   662 		} break;
   666 
   663 
   667 		case CO_COPY: {
   664 		case CO_COPY: {
   668 			Vehicle *src;
   665 			Vehicle *src;
   718 				dst->num_orders = src->num_orders;
   715 				dst->num_orders = src->num_orders;
   719 
   716 
   720 				InvalidateVehicleOrder(dst);
   717 				InvalidateVehicleOrder(dst);
   721 
   718 
   722 				RebuildVehicleLists();
   719 				RebuildVehicleLists();
   723 				if (dst->type == VEH_Train) dst->u.rail.shortest_platform[1] = 0; // we changed the orders so we invalidate the station length collector
       
   724 			}
   720 			}
   725 		} break;
   721 		} break;
   726 
   722 
   727 		case CO_UNSHARE: return DecloneOrder(dst, flags);
   723 		case CO_UNSHARE: return DecloneOrder(dst, flags);
   728 		default: return CMD_ERROR;
   724 		default: return CMD_ERROR;