tja2fumen.py
: Add workaround for deo_n.bin
song
I think this file has inaccurate metadata, so I've added a workaround so that it will still parse.
This commit is contained in:
parent
f586372343
commit
42f302eff0
@ -269,7 +269,12 @@ def readStruct(file, order, format_string, seek=None):
|
||||
"""
|
||||
if seek:
|
||||
file.seek(seek)
|
||||
byte_string = file.read(struct.calcsize(order + format_string))
|
||||
expected_size = struct.calcsize(order + format_string)
|
||||
byte_string = file.read(expected_size)
|
||||
# One "official" fumen (AC11\deo\deo_n.bin) runs out of data early
|
||||
# This workaround fixes the issue by appending 0's to get the size to match
|
||||
if len(byte_string) != expected_size:
|
||||
byte_string += (b'\x00' * (expected_size - len(byte_string)))
|
||||
interpreted_string = struct.unpack(order + format_string, byte_string)
|
||||
return interpreted_string
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user