src/vehicle.cpp
changeset 8838 068d63397dc3
parent 8837 72125f871eb4
child 8840 332412c2e9c1
equal deleted inserted replaced
8837:72125f871eb4 8838:068d63397dc3
  2241 		InvalidateWindow(WC_VEHICLE_VIEW, v->index);
  2241 		InvalidateWindow(WC_VEHICLE_VIEW, v->index);
  2242 
  2242 
  2243 		t = v->current_order;
  2243 		t = v->current_order;
  2244 		v->current_order.MakeDummy();
  2244 		v->current_order.MakeDummy();
  2245 
  2245 
  2246 		if (t.refit_cargo < NUM_CARGO) {
  2246 		if (t.IsRefit()) {
  2247 			CommandCost cost;
  2247 			CommandCost cost;
  2248 
  2248 
  2249 			_current_player = v->owner;
  2249 			_current_player = v->owner;
  2250 			cost = DoCommand(v->tile, v->index, t.refit_cargo | t.refit_subtype << 8, DC_EXEC, GetCmdRefitVeh(v));
  2250 			cost = DoCommand(v->tile, v->index, t.GetRefitCargo() | t.GetRefitSubtype() << 8, DC_EXEC, GetCmdRefitVeh(v));
  2251 
  2251 
  2252 			if (CmdFailed(cost)) {
  2252 			if (CmdFailed(cost)) {
  2253 				v->leave_depot_instantly = false; // We ensure that the vehicle stays in the depot
  2253 				v->leave_depot_instantly = false; // We ensure that the vehicle stays in the depot
  2254 				if (v->owner == _local_player) {
  2254 				if (v->owner == _local_player) {
  2255 					/* Notify the user that we stopped the vehicle */
  2255 					/* Notify the user that we stopped the vehicle */