Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
steven11sjf committed Oct 30, 2024
1 parent 393bb1b commit 167e9ad
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/mercury_engine_data_structures/formats/bmsstoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
Int32ul,
Int64ul,
PaddedString,
PrefixedArray,
Rebuild,
Struct,
)

from mercury_engine_data_structures.common_types import make_vector
from mercury_engine_data_structures.formats.base_resource import BaseResource
from mercury_engine_data_structures.formats.property_enum import PropertyEnum
from mercury_engine_data_structures.game_check import Game
Expand All @@ -41,8 +41,7 @@ class FileTypeEnum(enum.Enum):
"wav_name" / PropertyEnum,
"file_id" / FileId,
"warc_index" / Int32ul, # index of the WARC listed in BFSAR (starts offset from 0)
"idx" / Rebuild(Int32ul, lambda ctx: ctx._index), # 0 to max wave archives
Check(construct.this._index == construct.this.idx),
"idx" / Rebuild(Int32ul, construct.this._index), # 0 to max wave archives
Const(0, Int32ul),
Const(0, Int32ul),
Const(0, Int32ul),
Expand Down Expand Up @@ -74,9 +73,9 @@ class FileTypeEnum(enum.Enum):
)

BMSSTOC = Struct(
"wave_archives" / PrefixedArray(Int32ul, WaveArchiveData),
"sound_streams" / PrefixedArray(Int32ul, SoundStreams),
"groups" / PrefixedArray(Int32ul, GroupData),
"wave_archives" / make_vector(WaveArchiveData),
"sound_streams" / make_vector(SoundStreams),
"groups" / make_vector(GroupData),
construct.Terminated,
)

Expand Down

0 comments on commit 167e9ad

Please sign in to comment.