Bugfix: assemble_sound.py build corruption issues (#813)

This commit is contained in:
Gregory Heskett committed 2024-07-03 22:50:27 -04:00
1 parent a6782e6912
commit 4500ffb579
1 file changed
+16 -2
+16 -2
View File
@@ -781,10 +781,15 @@ def write_sequences(
defines, defines,
is_shindou, is_shindou,
): ):
bank_names = sorted( bank_names = []
[os.path.splitext(os.path.basename(x))[0] for x in os.listdir(sound_bank_dir)] banks = sorted(
[os.path.basename(x) for x in os.listdir(sound_bank_dir)]
) )
for x in banks:
if x.endswith(".json"):
bank_names.append(os.path.splitext(x)[0])
try: try:
with open(seq_json, "r") as inf: with open(seq_json, "r") as inf:
data = inf.read() data = inf.read()
@@ -842,6 +847,15 @@ def write_sequences(
while ind_to_name and json.get(ind_to_name[-1]) is None: while ind_to_name and json.get(ind_to_name[-1]) is None:
ind_to_name.pop() ind_to_name.pop()
if ind_to_name:
for x in range(len(ind_to_name)):
if ind_to_name[x] is None:
fail(
"Sequence file index jump detected. "
+ "Please make sure your sequence files are labeled correctly "
+ "in incremental hexadecimal order."
)
def serialize_file(name, ser, is_shindou): def serialize_file(name, ser, is_shindou):
if json.get(name) is None: if json.get(name) is None:
return return