Skip to content

Commit

Permalink
A more proper fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Dec 20, 2024
1 parent a970c2a commit 8cd48d5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/mercury_engine_data_structures/formats/bmscc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
)

Expand Down

0 comments on commit 8cd48d5

Please sign in to comment.