diff --git a/tools/assemble_sound.py b/tools/assemble_sound.py index 64141e66..885b1022 100755 --- a/tools/assemble_sound.py +++ b/tools/assemble_sound.py @@ -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