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

This commit is contained in:
Gregory Heskett
2024-07-02 23:53:46 -04:00
parent a6782e6912
commit 4500ffb579

View File

@@ -781,10 +781,15 @@ def write_sequences(
defines,
is_shindou,
):
bank_names = sorted(
[os.path.splitext(os.path.basename(x))[0] for x in os.listdir(sound_bank_dir)]
bank_names = []
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:
with open(seq_json, "r") as inf:
data = inf.read()
@@ -842,6 +847,15 @@ def write_sequences(
while ind_to_name and json.get(ind_to_name[-1]) is None:
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):
if json.get(name) is None:
return