diff --git a/src/mercury_engine_data_structures/formats/bmscc.py b/src/mercury_engine_data_structures/formats/bmscc.py index c3fec42..c78af3b 100644 --- a/src/mercury_engine_data_structures/formats/bmscc.py +++ b/src/mercury_engine_data_structures/formats/bmscc.py @@ -20,6 +20,7 @@ VersionAdapter, make_vector, ) +from mercury_engine_data_structures.construct_extensions.function_complex import ComplexIf from mercury_engine_data_structures.construct_extensions.misc import ErrorWithMessage from mercury_engine_data_structures.formats.collision import collision_formats @@ -63,7 +64,14 @@ VersionAdapter("1.16.0"), ), "layers" / make_vector(CollisionLayer), - "parts" / game_check.is_sr_or_else(construct.Terminated, make_vector(PartsComponent)), + "_remaining" / construct.Peek(construct.GreedyBytes), + "parts" / ComplexIf( + lambda this: ( + (this._parsing and this._remaining) + or (this._building and (this.parts is not None)) + ), + make_vector(PartsComponent) + ), construct.Terminated, )