From f86bb25477529ca3f6d3f45ac2bc6ff15e5a0b76 Mon Sep 17 00:00:00 2001 From: Thanatos Date: Tue, 19 Sep 2023 20:09:51 +0200 Subject: [PATCH] Apply alignment after header in pkg --- src/mercury_engine_data_structures/formats/pkg.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/mercury_engine_data_structures/formats/pkg.py b/src/mercury_engine_data_structures/formats/pkg.py index 01dee7a6..2e0e6da9 100644 --- a/src/mercury_engine_data_structures/formats/pkg.py +++ b/src/mercury_engine_data_structures/formats/pkg.py @@ -17,7 +17,7 @@ from mercury_engine_data_structures import dread_data, samus_returns_data from mercury_engine_data_structures.construct_extensions.alignment import AlignTo from mercury_engine_data_structures.formats.base_resource import AssetId, BaseResource, NameOrAssetId, resolve_asset_id -from mercury_engine_data_structures.game_check import Game, get_current_game +from mercury_engine_data_structures.game_check import Game def _file_entry(target_game: Game): @@ -73,9 +73,8 @@ def _parse(self, stream, context, path) -> construct.Container: # Get the file headers file_headers = self.file_headers_type._parsereport(stream, context, path) - if get_current_game(context) == Game.DREAD: - # Align to 128 bytes - AlignTo(128)._parsereport(stream, context, path) + # Align to 128 bytes + AlignTo(128)._parsereport(stream, context, path) files = construct.ListContainer() for i, header in enumerate(file_headers): @@ -99,9 +98,8 @@ def _build(self, obj: construct.Container, stream, context, path): # Skip over file headers construct.stream_seek(stream, len(obj.files) * file_entry_size, 1, path) - if get_current_game(context) == Game.DREAD: - # Align to 128 bytes - AlignTo(128)._build(None, stream, context, path) + # Align to 128 bytes + AlignTo(128)._build(None, stream, context, path) header_end = construct.stream_tell(stream, path)