@@ -831,7 +831,21 @@ def generated_function(value):
831831 return generated_function
832832
833833
834-
834+ def invert_bridge_pillars_flags (value ):
835+ out = ConstantNumeric (0 , value .pos )
836+ for i_flag , o_flag in [
837+ (global_constants .constant_numbers ["BRIDGE_PILLAR_CORNER_W" ], global_constants .constant_numbers ["BRIDGE_PILLAR_CORNER_S" ]),
838+ (global_constants .constant_numbers ["BRIDGE_PILLAR_CORNER_S" ], global_constants .constant_numbers ["BRIDGE_PILLAR_CORNER_W" ]),
839+ (global_constants .constant_numbers ["BRIDGE_PILLAR_CORNER_N" ], global_constants .constant_numbers ["BRIDGE_PILLAR_CORNER_E" ]),
840+ (global_constants .constant_numbers ["BRIDGE_PILLAR_CORNER_E" ], global_constants .constant_numbers ["BRIDGE_PILLAR_CORNER_N" ]),
841+ (global_constants .constant_numbers ["BRIDGE_PILLAR_EDGE_NE" ], global_constants .constant_numbers ["BRIDGE_PILLAR_EDGE_NE" ]),
842+ (global_constants .constant_numbers ["BRIDGE_PILLAR_EDGE_SE" ], global_constants .constant_numbers ["BRIDGE_PILLAR_EDGE_SW" ]),
843+ (global_constants .constant_numbers ["BRIDGE_PILLAR_EDGE_SW" ], global_constants .constant_numbers ["BRIDGE_PILLAR_EDGE_SE" ]),
844+ (global_constants .constant_numbers ["BRIDGE_PILLAR_EDGE_NW" ], global_constants .constant_numbers ["BRIDGE_PILLAR_EDGE_NW" ]),
845+ ] :
846+ if value .value & (1 << i_flag ):
847+ out .value += 1 << o_flag
848+ return out
835849
836850
837851# fmt: off
@@ -860,7 +874,7 @@ def generated_function(value):
860874 "classname" : {"size" : 2 , "num" : (256 , - 1 , 0x1D ), "string" : (256 , 0xC4 , 0xDC )},
861875 "tile_flags" : {"custom_function" : station_tile_flags }, # = prop 1E
862876 "minimum_bridge_height" : {"custom_function" : array_for_station_properties (0x20 , "Bridge heights" , 10 , lambda v : v )},
863- "bridge_pillars_flags" : {"custom_function" : array_for_station_properties (0x21 , "Flag" , 10 , lambda v : v )},
877+ "bridge_pillars_flags" : {"custom_function" : array_for_station_properties (0x21 , "Flag" , 10 , invert_bridge_pillars_flags )},
864878}
865879# fmt: on
866880
0 commit comments