@@ -34,7 +34,7 @@ std::unique_ptr<PackFile> PCK::create(const std::string& path, uint32_t version,
3434
3535 if (version > 1 ) {
3636 stream
37- .write (FlagsV2::FLAG_NONE )
37+ .write (FLAG_DIR_NONE )
3838 .write <uint64_t >(0 );
3939 }
4040
@@ -80,20 +80,20 @@ std::unique_ptr<PackFile> PCK::open(const std::string& path, const EntryCallback
8080 reader.read (pck->header .godotVersionMinor );
8181 reader.read (pck->header .godotVersionPatch );
8282
83- pck->header .flags = FLAG_NONE ;
83+ pck->header .flags = FLAG_DIR_NONE ;
8484 std::size_t extraEntryContentsOffset = 0 ;
8585 if (pck->header .packVersion > 1 ) {
86- pck->header .flags = reader.read <FlagsV2 >();
86+ pck->header .flags = reader.read <FlagsDirV2 >();
8787 extraEntryContentsOffset = reader.read <uint64_t >();
8888 }
8989
90- if (pck->header .flags & FLAG_ENCRYPTED ) {
90+ if (pck->header .flags & FLAG_DIR_ENCRYPTED ) {
9191 // File directory is encrypted
9292 return nullptr ;
9393 }
94- if (pck->header .flags & FLAG_RELATIVE_FILE_DATA ) {
94+ if (pck->header .flags & FLAG_DIR_RELATIVE_FILE_DATA ) {
9595 extraEntryContentsOffset += pck->startOffset ;
96- pck->header .flags = static_cast <FlagsV2 >(pck->header .flags & ~FLAG_RELATIVE_FILE_DATA );
96+ pck->header .flags = static_cast <FlagsDirV2 >(pck->header .flags & ~FLAG_DIR_RELATIVE_FILE_DATA );
9797 }
9898
9999 // Reserved
@@ -115,6 +115,9 @@ std::unique_ptr<PackFile> PCK::open(const std::string& path, const EntryCallback
115115
116116 if (pck->header .packVersion > 1 ) {
117117 entry.flags = reader.read <uint32_t >();
118+ if (entry.flags & FLAG_FILE_REMOVED) {
119+ continue ;
120+ }
118121 }
119122
120123 pck->entries .emplace (entryPath, entry);
@@ -141,7 +144,7 @@ std::optional<std::vector<std::byte>> PCK::readEntry(const std::string& path_) c
141144 }
142145
143146 // It's baked into the file on disk
144- if (entry->flags & FLAG_ENCRYPTED ) {
147+ if (entry->flags & FLAG_FILE_ENCRYPTED ) {
145148 // File is encrypted
146149 return std::nullopt ;
147150 }
@@ -297,7 +300,7 @@ PCK::operator std::string() const {
297300 if (this ->startOffset > 0 ) {
298301 out += " | Embedded" ;
299302 }
300- if (this ->header .flags & FLAG_ENCRYPTED ) {
303+ if (this ->header .flags & FLAG_DIR_ENCRYPTED ) {
301304 out += " | Encrypted" ;
302305 }
303306 return out;
0 commit comments