src/train_cmd.cpp
changeset 7068 846986cf3a6e
parent 7061 81d3a68972b5
child 7069 9c50360195ff
equal deleted inserted replaced
7067:ea55b6046015 7068:846986cf3a6e
   112 		uint32 vweight = GetCargo(u->cargo_type)->weight * u->cargo_count * FreightWagonMult(u->cargo_type) / 16;
   112 		uint32 vweight = GetCargo(u->cargo_type)->weight * u->cargo_count * FreightWagonMult(u->cargo_type) / 16;
   113 
   113 
   114 		/* Vehicle weight is not added for articulated parts. */
   114 		/* Vehicle weight is not added for articulated parts. */
   115 		if (!IsArticulatedPart(u)) {
   115 		if (!IsArticulatedPart(u)) {
   116 			/* vehicle weight is the sum of the weight of the vehicle and the weight of its cargo */
   116 			/* vehicle weight is the sum of the weight of the vehicle and the weight of its cargo */
   117 			vweight += RailVehInfo(u->engine_type)->weight;
   117 			vweight += GetVehicleProperty(u, 0x16, RailVehInfo(u->engine_type)->weight);
   118 
   118 
   119 			/* powered wagons have extra weight added */
   119 			/* powered wagons have extra weight added */
   120 			if (HASBIT(u->u.rail.flags, VRF_POWEREDWAGON))
   120 			if (HASBIT(u->u.rail.flags, VRF_POWEREDWAGON))
   121 				vweight += RailVehInfo(u->u.rail.first_engine)->pow_wag_weight;
   121 				vweight += RailVehInfo(u->u.rail.first_engine)->pow_wag_weight;
   122 		}
   122 		}