Fixed scp.py

*Fixed scp.py allowing for any Misc object (instead of just SignalBoxes and Plaforms)
This commit is contained in:
izawartka 2025-07-25 20:38:38 +02:00
parent 05576e79ee
commit 4131401fe6

View File

@ -5,19 +5,19 @@ import sys
#
# [ TD2 SCENERY PROCESSOR ]
# by masuo
# v1.7
# v1.8
#
BAD_WORDS = ['Fence', 'TerrainPoint', 'Wires']
MISC_REGEX = r'^(?:SignalBox|wgt_peron|peron|platform).*$'
MISC_REGEX = r'^(?:MiscGroup.*|Misc;[^;]*;(?:SignalBox|wgt_peron|peron|platform).*)$'
def should_exclude(line: str) -> bool:
for word in BAD_WORDS:
if line.startswith(word):
return True
if line.startswith("Misc") and not line.startswith("MiscGroup"):
if re.match(MISC_REGEX, line):
if line.startswith("Misc"):
if not re.match(MISC_REGEX, line):
return True
return False