equal
deleted
inserted
replaced
116 const RailVehicleInfo *rvi_u = RailVehInfo(u->engine_type); |
116 const RailVehicleInfo *rvi_u = RailVehInfo(u->engine_type); |
117 |
117 |
118 if (engine_has_power) { |
118 if (engine_has_power) { |
119 uint16 power = GetVehicleProperty(u, 0x0B, rvi_u->power); |
119 uint16 power = GetVehicleProperty(u, 0x0B, rvi_u->power); |
120 if (power != 0) { |
120 if (power != 0) { |
|
121 /* Halve power for multiheaded parts */ |
|
122 if (IsMultiheaded(u)) power /= 2; |
|
123 |
121 total_power += power; |
124 total_power += power; |
122 /* Tractive effort in (tonnes * 1000 * 10 =) N */ |
125 /* Tractive effort in (tonnes * 1000 * 10 =) N */ |
123 max_te += (u->u.rail.cached_veh_weight * 10000 * GetVehicleProperty(u, 0x1F, rvi_u->tractive_effort)) / 256; |
126 max_te += (u->u.rail.cached_veh_weight * 10000 * GetVehicleProperty(u, 0x1F, rvi_u->tractive_effort)) / 256; |
124 } |
127 } |
125 } |
128 } |
3497 const RailVehicleInfo *rvi = RailVehInfo(v->engine_type); |
3500 const RailVehicleInfo *rvi = RailVehInfo(v->engine_type); |
3498 |
3501 |
3499 byte cost_factor = GetVehicleProperty(v, 0x0D, rvi->running_cost); |
3502 byte cost_factor = GetVehicleProperty(v, 0x0D, rvi->running_cost); |
3500 if (cost_factor == 0) continue; |
3503 if (cost_factor == 0) continue; |
3501 |
3504 |
|
3505 /* Halve running cost for multiheaded parts */ |
|
3506 if (IsMultiheaded(v)) cost_factor /= 2; |
|
3507 |
3502 cost += cost_factor * GetPriceByIndex(rvi->running_cost_class); |
3508 cost += cost_factor * GetPriceByIndex(rvi->running_cost_class); |
3503 } while ((v = GetNextVehicle(v)) != NULL); |
3509 } while ((v = GetNextVehicle(v)) != NULL); |
3504 |
3510 |
3505 return cost; |
3511 return cost; |
3506 } |
3512 } |