Skip to content

Commit

Permalink
Fix: some properties must be explicitly set to 0 for trailing articul…
Browse files Browse the repository at this point in the history
…ated parts (b251374 broke company colour for trailing parts of wagons)
  • Loading branch information
andythenorth committed Aug 17, 2022
1 parent 1b6b70f commit aebd97a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/templates/properties_vehicle.pynml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ item(FEAT_TRAINS, ${vehicle.id}, ${vehicle.numeric_id}) {
name: ${consist.name};
climates_available: NO_CLIMATE; // nml constant
<tal:lead_unit_of_consist_only condition="vehicle.is_lead_unit_of_consist">
<!--! some properties should not be set for trailing parts of articulated consists
unclear if these should be explicitly set to 0 or not, if necessary that can be done later -->
<!--! some properties should not be set for trailing parts of articulated consists -->
engine_class: ${vehicle.engine_class};
introduction_date: date(${consist.intro_year}, ${1 + consist.intro_date_months_offset}, 1);
weight: ${consist.weight}ton;
power: ${consist.power}hp;
weight: ${consist.weight}ton;
tractive_effort_coefficient: ${consist.tractive_effort_coefficient};
cost_factor: 0; // use the CB to set this, the prop is capped to max 255, cb is 32k
running_cost_base: ${vehicle.running_cost_base};
Expand All @@ -95,6 +94,15 @@ item(FEAT_TRAINS, ${vehicle.id}, ${vehicle.numeric_id}) {
reliability_decay: 20; // default value
vehicle_life: ${consist.vehicle_life};
</tal:lead_unit_of_consist_only>
<tal:trailing_parts_of_consist_only condition="not vehicle.is_lead_unit_of_consist">
<!--! some properties must be explicitly set to 0 for trailing parts -->
power: 0;
weight: 0;
tractive_effort_coefficient: 0;
cost_factor: 0;
running_cost_base: RUNNING_COST_NONE;
running_cost_factor: 0;
</tal:trailing_parts_of_consist_only>
<tal:speed_is_optional condition="consist.speed is not None">
speed: ${consist.speed}mph;
</tal:speed_is_optional>
Expand Down

0 comments on commit aebd97a

Please sign in to comment.