Skip to content

Commit f4f19c4

Browse files
authored
Debugging
1 parent 1b2785e commit f4f19c4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ def load_textdata(self, scriptname: str) -> Any:
4343
ret = {}
4444
textdata_regex = re.compile(r"ds_map_add\(global\.text_data_[a-z]+, \"([a-zA-Z0-9_]+)\", ([\"'])(.*)\2\)")
4545
with open(lang_file, 'r') as file:
46+
print("Successfully opened", lang_file)
4647
for line in file.readlines():
4748
if not line.startswith("ds_map_add"):
4849
continue
4950
line = line.replace("' + \"'\" + '", "'").replace('" + \'"\' + "', '"')
5051
matches = textdata_regex.match(line)
51-
ret[matches[1]] = matches[3]
52+
if matches is not None:
53+
ret[matches[1]] = matches[3]
5254
return ret
5355

5456
def load_enemies(self) -> List[str]:
@@ -66,6 +68,7 @@ def load_sums(self) -> Dict[str, str]:
6668
return self.load_json('sums')
6769

6870
def load_lang(self) -> Dict[str, str]:
71+
print("Game:", self.game)
6972
if self.game == 'undertale':
7073
return self.load_textdata('gml_Script_textdata_en')
7174
return self.load_json('lang_en')

0 commit comments

Comments
 (0)