train_cmd.c
changeset 15 255d0f685325
parent 11 836bc4b37b5b
child 19 6080d2b6a959
equal deleted inserted replaced
14:8289d2a744c0 15:255d0f685325
  1013 	cost = 0;
  1013 	cost = 0;
  1014 	num = 0;
  1014 	num = 0;
  1015 
  1015 
  1016 	do {
  1016 	do {
  1017 		if (!(_rail_vehicle_info[v->engine_type].flags & RVI_WAGON) && (byte)p2 != v->cargo_type && v->cargo_cap != 0) {
  1017 		if (!(_rail_vehicle_info[v->engine_type].flags & RVI_WAGON) && (byte)p2 != v->cargo_type && v->cargo_cap != 0) {
  1018 			cost += (_price.ship_base >> 7);
  1018 			cost += (_price.build_railvehicle >> 8);
  1019 			num += v->cargo_cap;
  1019 			num += v->cargo_cap;
  1020 			if (flags & DC_EXEC) {
  1020 			if (flags & DC_EXEC) {
  1021 				v->cargo_count = 0;
  1021 				v->cargo_count = 0;
  1022 				v->cargo_type = (byte)p2;
  1022 				v->cargo_type = (byte)p2;
  1023 				InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
  1023 				InvalidateWindow(WC_VEHICLE_DETAILS, v->index);