src/ship_cmd.cpp
branchNewGRF_ports
changeset 6870 ca3fd1fbe311
parent 6868 7eb395287b3d
child 6871 5a9dc001e1ad
equal deleted inserted replaced
6869:76282d3b748d 6870:ca3fd1fbe311
  1002 		if (!!(p2 & DEPOT_SERVICE) == HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
  1002 		if (!!(p2 & DEPOT_SERVICE) == HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
  1003 			/* We called with a different DEPOT_SERVICE setting.
  1003 			/* We called with a different DEPOT_SERVICE setting.
  1004 			 * Now we change the setting to apply the new one and let the vehicle head for the same depot.
  1004 			 * Now we change the setting to apply the new one and let the vehicle head for the same depot.
  1005 			 * Note: the if is (true for requesting service == true for ordered to stop in depot)          */
  1005 			 * Note: the if is (true for requesting service == true for ordered to stop in depot)          */
  1006 			if (flags & DC_EXEC) {
  1006 			if (flags & DC_EXEC) {
       
  1007 				CLRBIT(v->current_order.flags, OFB_PART_OF_ORDERS);
  1007 				TOGGLEBIT(v->current_order.flags, OFB_HALT_IN_DEPOT);
  1008 				TOGGLEBIT(v->current_order.flags, OFB_HALT_IN_DEPOT);
  1008 				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
  1009 				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
  1009 			}
  1010 			}
  1010 			return CommandCost();
  1011 			return CommandCost();
  1011 		}
  1012 		}
  1076 	if (new_cid >= NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
  1077 	if (new_cid >= NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
  1077 
  1078 
  1078 	SET_EXPENSES_TYPE(EXPENSES_SHIP_RUN);
  1079 	SET_EXPENSES_TYPE(EXPENSES_SHIP_RUN);
  1079 
  1080 
  1080 	/* Check the refit capacity callback */
  1081 	/* Check the refit capacity callback */
  1081 	if (HASBIT(EngInfo(v->engine_type)->callbackmask, CBM_REFIT_CAPACITY)) {
  1082 	if (HASBIT(EngInfo(v->engine_type)->callbackmask, CBM_VEHICLE_REFIT_CAPACITY)) {
  1082 		/* Back up the existing cargo type */
  1083 		/* Back up the existing cargo type */
  1083 		CargoID temp_cid = v->cargo_type;
  1084 		CargoID temp_cid = v->cargo_type;
  1084 		byte temp_subtype = v->cargo_subtype;
  1085 		byte temp_subtype = v->cargo_subtype;
  1085 		v->cargo_type = new_cid;
  1086 		v->cargo_type = new_cid;
  1086 		v->cargo_subtype = new_subtype;
  1087 		v->cargo_subtype = new_subtype;