1
0
mirror of https://github.com/mon/ifstools.git synced 2024-11-30 19:54:27 +01:00

Fix super-file edge case

This commit is contained in:
Will Toohey 2020-04-12 11:27:02 +10:00
parent 87241fd540
commit baf8252e42

View File

@ -57,7 +57,10 @@ class GenericFolder(Node):
super_ifs = self.supers[super_ref - 1] super_ifs = self.supers[super_ref - 1]
super_files = super_ifs.tree.all_files super_files = super_ifs.tree.all_files
try: try:
super_file = next(x for x in super_files if x.name == filename) super_file = next(x for x in super_files if (
# seen in Sunny Park files: references to MD5 name instead of base
x.name == filename or x.packed_name == Node.sanitize_name(filename)
))
except StopIteration: except StopIteration:
raise IOError('IFS references super-IFS entry {} in {} but it does not exist'.format(filename, super_ifs.ifs_out)) raise IOError('IFS references super-IFS entry {} in {} but it does not exist'.format(filename, super_ifs.ifs_out))