train_cmd.c
changeset 1087 2837dee262a8
parent 1067 3ba7987a004e
child 1093 4fdc46eaf423
equal deleted inserted replaced
1086:adbaa5bda683 1087:2837dee262a8
    98 	do {
    98 	do {
    99 		const RailVehicleInfo *rvi = RailVehInfo(u->engine_type);
    99 		const RailVehicleInfo *rvi = RailVehInfo(u->engine_type);
   100 		uint mass = rvi->weight + ((_cargoc.weights[u->cargo_type] * u->cargo_count) >> 4);
   100 		uint mass = rvi->weight + ((_cargoc.weights[u->cargo_type] * u->cargo_count) >> 4);
   101 		if (rvi->power) emass += mass;
   101 		if (rvi->power) emass += mass;
   102 
   102 
   103 		if (HASBIT(u->u.rail.flags, VRF_GOINGUP)) {
   103 		if (!IsTileType(u->tile, MP_TUNNELBRIDGE)) {
   104 			f += (float)mass * ( -F_GRAV * F_THETA);
   104 			if (HASBIT(u->u.rail.flags, VRF_GOINGUP)) {
   105 		} else if (HASBIT(u->u.rail.flags, VRF_GOINGDOWN)) {
   105 				f += (float)mass * ( -F_GRAV * F_THETA);
   106 			f += (float)mass * ( F_GRAV * F_THETA);
   106 			} else if (HASBIT(u->u.rail.flags, VRF_GOINGDOWN)) {
       
   107 				f += (float)mass * ( F_GRAV * F_THETA);
       
   108 			}
   107 		}
   109 		}
   108 
   110 
   109 		// compute curve penalty..
   111 		// compute curve penalty..
   110 		if (u->next != NULL) {
   112 		if (u->next != NULL) {
   111 			uint diff = (u->direction - u->next->direction) & 7;
   113 			uint diff = (u->direction - u->next->direction) & 7;