AreaFile.load_helps indexes the keyword before checking it:
https://github.com/ctoth/area_reader/blob/3297b88/area_reader/__init__.py#L380-L389
def load_helps(self):
while True:
level = self.read_number()
keyword = self.read_string()
if keyword[0] == '$':
break
A help entry with an empty keyword (5 ~) makes keyword[0] raise IndexError, which the section wrapper re-raises as a generic ParseError. Reproduced:
#HELPS
5 ~
some text~
0 $~
ParseError: ...\h.are line 8 col 3 in section helps: Error reading section 'helps'
(underlying: IndexError from keyword[0])
ROM's C loader accepts this file: fread_string returns an empty string and keyword[0] is '\0', which is not '$', so the help is stored. So this is a file the reference engine loads and area_reader rejects.
Fix: if keyword.startswith('$'):.
AreaFile.load_helpsindexes the keyword before checking it:https://github.com/ctoth/area_reader/blob/3297b88/area_reader/__init__.py#L380-L389
A help entry with an empty keyword (
5 ~) makeskeyword[0]raiseIndexError, which the section wrapper re-raises as a generic ParseError. Reproduced:ROM's C loader accepts this file:
fread_stringreturns an empty string andkeyword[0]is'\0', which is not'$', so the help is stored. So this is a file the reference engine loads and area_reader rejects.Fix:
if keyword.startswith('$'):.