src/order_cmd.cpp
changeset 8424 4a488a90ccab
parent 8316 1dbc648c7c64
child 8425 72a71d480c5f
equal deleted inserted replaced
8423:8453e9a0f0b5 8424:4a488a90ccab
   505 			assert(v->orders == u->orders);
   505 			assert(v->orders == u->orders);
   506 
   506 
   507 			/* NON-stop flag is misused to see if a train is in a station that is
   507 			/* NON-stop flag is misused to see if a train is in a station that is
   508 			 * on his order list or not */
   508 			 * on his order list or not */
   509 			if (sel_ord == u->cur_order_index && u->current_order.type == OT_LOADING &&
   509 			if (sel_ord == u->cur_order_index && u->current_order.type == OT_LOADING &&
   510 					HASBIT(u->current_order.flags, OFB_NON_STOP)) {
   510 					HasBit(u->current_order.flags, OFB_NON_STOP)) {
   511 				u->current_order.flags = 0;
   511 				u->current_order.flags = 0;
   512 			}
   512 			}
   513 
   513 
   514 			/* Update any possible open window of the vehicle */
   514 			/* Update any possible open window of the vehicle */
   515 			InvalidateVehicleOrder(u);
   515 			InvalidateVehicleOrder(u);
   547 
   547 
   548 		if (v->current_order.type == OT_LOADING) {
   548 		if (v->current_order.type == OT_LOADING) {
   549 			v->LeaveStation();
   549 			v->LeaveStation();
   550 			/* NON-stop flag is misused to see if a train is in a station that is
   550 			/* NON-stop flag is misused to see if a train is in a station that is
   551 			 * on his order list or not */
   551 			 * on his order list or not */
   552 			if (HASBIT(v->current_order.flags, OFB_NON_STOP)) v->current_order.flags = 0;
   552 			if (HasBit(v->current_order.flags, OFB_NON_STOP)) v->current_order.flags = 0;
   553 		}
   553 		}
   554 
   554 
   555 		InvalidateVehicleOrder(v);
   555 		InvalidateVehicleOrder(v);
   556 	}
   556 	}
   557 
   557 
   717 				 * so do not care and those orders should not be active
   717 				 * so do not care and those orders should not be active
   718 				 * when this function is called.
   718 				 * when this function is called.
   719 				 */
   719 				 */
   720 				if (sel_ord == u->cur_order_index &&
   720 				if (sel_ord == u->cur_order_index &&
   721 						u->current_order.type != OT_GOTO_DEPOT &&
   721 						u->current_order.type != OT_GOTO_DEPOT &&
   722 						HASBIT(u->current_order.flags, OFB_FULL_LOAD) != HASBIT(order->flags, OFB_FULL_LOAD)) {
   722 						HasBit(u->current_order.flags, OFB_FULL_LOAD) != HasBit(order->flags, OFB_FULL_LOAD)) {
   723 					TOGGLEBIT(u->current_order.flags, OFB_FULL_LOAD);
   723 					TOGGLEBIT(u->current_order.flags, OFB_FULL_LOAD);
   724 				}
   724 				}
   725 				InvalidateVehicleOrder(u);
   725 				InvalidateVehicleOrder(u);
   726 			}
   726 			}
   727 		}
   727 		}
   900 		for (; u != NULL; u = u->next_shared) {
   900 		for (; u != NULL; u = u->next_shared) {
   901 			/* Update any possible open window of the vehicle */
   901 			/* Update any possible open window of the vehicle */
   902 			InvalidateVehicleOrder(u);
   902 			InvalidateVehicleOrder(u);
   903 
   903 
   904 			/* If the vehicle already got the current depot set as current order, then update current order as well */
   904 			/* If the vehicle already got the current depot set as current order, then update current order as well */
   905 			if (u->cur_order_index == order_number && HASBIT(u->current_order.flags, OFB_PART_OF_ORDERS)) {
   905 			if (u->cur_order_index == order_number && HasBit(u->current_order.flags, OFB_PART_OF_ORDERS)) {
   906 				u->current_order.refit_cargo = cargo;
   906 				u->current_order.refit_cargo = cargo;
   907 				u->current_order.refit_subtype = subtype;
   907 				u->current_order.refit_subtype = subtype;
   908 			}
   908 			}
   909 		}
   909 		}
   910 	}
   910 	}