From 8cd48d56d0cb7dabc9ffff963c82bf6d7ad461e0 Mon Sep 17 00:00:00 2001 From: dyceron Date: Thu, 19 Dec 2024 22:30:31 -0500 Subject: [PATCH] A more proper fix --- src/mercury_engine_data_structures/formats/bmscc.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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, )