Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Prevent characters in materials and messages from breaking the importer #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ def file_parser(file):
extracted = []

for line in vmf.readlines()[1:]:
if "}" in line:
if "}" in line and '"' not in line:
indent -= 1
if indent == 0: # If indent is not 0 we know it's a child category and not a main category
extracted.append(t)
continue

if "{" in line:
if "{" in line and '"' not in line:
if indent > 0: # If indent is not 0 we know it's a child category and not a main category
# Open curly brackets ALWAYS follow a category, so we know the previous line is the category name
t.add_child(previous_line, indent)
Expand Down