Signalboxes and signals recognition bugfix
*Fixed scp.py removing signal boxes with no name *Fixed the parser skipping mechanical signals *Improved loading speed of unoptimized .sc files by throwing less unknownObjectType warnings
This commit is contained in:
parent
0aafbe6960
commit
18e3056c45
@ -102,6 +102,11 @@ export default class Scenery
|
||||
return Scenery._parseMisc(text);
|
||||
case 'Empty':
|
||||
case 'EndRoute':
|
||||
case 'MiscGroup':
|
||||
case 'EndMiscGroup':
|
||||
case 'Wires':
|
||||
case 'Fence':
|
||||
case 'TerrainPoint':
|
||||
return null;
|
||||
default:
|
||||
SceneryParserLog.warn('unknownObjectType', `Unknown object type: ${type}`);
|
||||
|
||||
@ -57,6 +57,7 @@ export default class Signal extends TrackObject {
|
||||
if(values.length < 29) return false;
|
||||
|
||||
const prefabInfo = values[2].split(",");
|
||||
if(/^sk\d+_[a-zA-Z]+$/.test(prefabInfo[0])) return true; // mechanical signals
|
||||
if(prefabInfo.length < 2) return false;
|
||||
|
||||
return true;
|
||||
|
||||
@ -4,7 +4,7 @@ import sys
|
||||
#
|
||||
# [ TD2 SCENERY PROCESSOR ]
|
||||
# by masuo
|
||||
# v1.3
|
||||
# v1.4
|
||||
#
|
||||
|
||||
BAD_WORDS = ['Empty,Empty', 'Forest Start,Forest Start', 'EndMiscGroup', 'Fence', 'TerrainPoint', 'Wires']
|
||||
@ -16,7 +16,7 @@ def should_exclude(line: str) -> bool:
|
||||
|
||||
if line.startswith("Misc"):
|
||||
values = line.split(';')
|
||||
return len(values[9].strip()) == 0 or not values[2].startswith("SignalBox")
|
||||
return not values[2].startswith("SignalBox")
|
||||
|
||||
def process_file(file_path: str):
|
||||
if not file_path.endswith(".sc"):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user