train_cmd.c
changeset 3955 81e7e25e4599
parent 3954 634cd5e35803
child 3956 0f43adbc293a
equal deleted inserted replaced
3954:634cd5e35803 3955:81e7e25e4599
  1787 
  1787 
  1788 			if (amount != 0) {
  1788 			if (amount != 0) {
  1789 				if (new_cid != v->cargo_type) cost += _price.build_railvehicle >> 8;
  1789 				if (new_cid != v->cargo_type) cost += _price.build_railvehicle >> 8;
  1790 				num += amount;
  1790 				num += amount;
  1791 				if (flags & DC_EXEC) {
  1791 				if (flags & DC_EXEC) {
  1792 					v->cargo_count = 0;
  1792 					v->cargo_count = (v->cargo_type == new_cid) ? min(amount, v->cargo_count) : 0;
  1793 					v->cargo_type = new_cid;
  1793 					v->cargo_type = new_cid;
  1794 					v->cargo_cap = amount;
  1794 					v->cargo_cap = amount;
  1795 					v->cargo_subtype = new_subtype;
  1795 					v->cargo_subtype = new_subtype;
  1796 					InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
  1796 					InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
  1797 					InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
  1797 					InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);