From 80bf47be279ca09df36f4454b84c0fe14f25e2ec Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Feb 2024 10:53:03 +0000 Subject: [PATCH] Change: railcar trailers only show pantographs if an appropriate cab car is in the consist --- .../vehicle_consist_position_dependent.pynml | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/templates/vehicle_consist_position_dependent.pynml b/src/templates/vehicle_consist_position_dependent.pynml index 689c14334..592643726 100644 --- a/src/templates/vehicle_consist_position_dependent.pynml +++ b/src/templates/vehicle_consist_position_dependent.pynml @@ -25,10 +25,30 @@ ${vehicle.get_spriteset_template_name_2('unreversed', 10 + (position_variant_num * 30))} } - switch (FEAT_TRAINS, SELF, ${vehicle.id}_switch_graphics_pantographs_${position_variant_num}, ${consist.nml_expression_for_vehicle_is_electrically_powered_by_tile()}) { + switch (FEAT_TRAINS, SELF, ${vehicle.id}_switch_graphics_pantographs_state_${position_variant_num}, ${consist.nml_expression_for_vehicle_is_electrically_powered_by_tile()}) { 1: return ${vehicle.id}_ss_pantographs_up_${position_variant_num}; return ${vehicle.id}_ss_pantographs_down_${position_variant_num}; } + + switch (FEAT_TRAINS, PARENT, ${vehicle.id}_switch_graphics_pantographs_${position_variant_num}, + [ + + ${int(not consist.suppress_pantograph_if_no_engine_attached)} + + || + + count_veh_id(${unit_variant.id}) > 0 + + || + + + + ] + ) { + 1: return ${vehicle.id}_switch_graphics_pantographs_state_${position_variant_num}; + return ss_global_empty_vehicle; + }