train_cmd.c
changeset 4242 e6baba95f369
parent 4198 fcb0808731db
child 4244 44dcec623504
equal deleted inserted replaced
4241:dbf983b1e87b 4242:e6baba95f369
  1792 					default:       amount /= 4; break;
  1792 					default:       amount /= 4; break;
  1793 				}
  1793 				}
  1794 			};
  1794 			};
  1795 
  1795 
  1796 			if (amount != 0) {
  1796 			if (amount != 0) {
  1797 				if (new_cid != v->cargo_type) cost += _price.build_railvehicle >> 8;
  1797 				if (new_cid != v->cargo_type) {
       
  1798 					int32 base_cost = (rvi->flags & RVI_WAGON) ?
       
  1799 						_price.build_railwagon : _price.build_railvehicle;
       
  1800 					cost += (EngInfo(v->engine_type)->refit_cost * base_cost) >> 9;
       
  1801 				}
       
  1802 
  1798 				num += amount;
  1803 				num += amount;
  1799 				if (flags & DC_EXEC) {
  1804 				if (flags & DC_EXEC) {
  1800 					v->cargo_count = (v->cargo_type == new_cid) ? min(amount, v->cargo_count) : 0;
  1805 					v->cargo_count = (v->cargo_type == new_cid) ? min(amount, v->cargo_count) : 0;
  1801 					v->cargo_type = new_cid;
  1806 					v->cargo_type = new_cid;
  1802 					v->cargo_cap = amount;
  1807 					v->cargo_cap = amount;