Skip to content

fix(archivefile): Only list archive subdirectories when asked - #3458

Merged
stephanmeesters merged 1 commit into
TheSuperHackers:mainfrom
tintinhamans:arctic/fix/archive-list-subdirectories
Nov 28, 2026
Merged

stephanmeesters merged 1 commit into
TheSuperHackers:mainfrom
tintinhamans:arctic/fix/archive-list-subdirectories

Conversation

@tintinhamans

@tintinhamans tintinhamans commented Oct 10, 2026 •

Copy link
Copy Markdown

ArchiveFile::getFileListInDirectory always goes into subdirectories. The searchSubdirectories flag gets passed down the recursion but nothing ever checks it, so FALSE acts like TRUE for anything in a .big. Loose files already respect it.

Now archives skip subdirectories unless you ask for them.

I ran into this while working on string file loading, where asking for data\ also gave me data\English\generals.csf.

Nothing changes for INI loading, every INI directory load asks for subdirectories anyway. INI CRC is FEAAE3F3 on main and with this.

The existing callers that pass FALSE are the replay menu and four WorldBuilder panels. None of them gets a file out of an archive before or after, their paths start with .., . or a drive letter. The replay menu lists the same replays on main and with this.

Also ran WorldBuilder on main and with this: with a few test molds in Data\Editor\Molds\ (loose, in a subfolder, and in a .big) the mesh mold list has the same 3 entries on both, and every other tree in it has the same item count.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

ArchiveFile::getFileListInDirectory traverses child directories only when searchSubdirectories is true. It continues to check files in the current directory regardless of that setting.

Changes

Archive Directory Listing

Layer / File(s) Summary
Conditional directory traversal
Core/GameEngine/Source/Common/System/ArchiveFile.cpp
The function skips child directories when searchSubdirectories is false and continues to process files in the current directory.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Suggested labels: Fix

Suggested reviewers: bobtista

Merge Risk: Minimal · up to 43e91

Archive directory listings now skip subdirectories unless they are requested. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: archive directory listings now include subdirectories only when searchSubdirectories is TRUE. The raw summary confirms ArchiveFile::getFileListInDirectory now traverses chi…
Description check Passed The description explains the problem. getFileListInDirectory always enters subdirectories, and the searchSubdirectories flag is passed through recursion but never checked. It also covers the fix, the …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: archive directory listings now include subdirectories only when searchSubdirectories is TRUE. The raw summary confirms ArchiveFile::getFileListInDirectory now traverses child directories only under that flag, so the title matches the main change.

Full details: Description check

Explanation

The description explains the problem. getFileListInDirectory always enters subdirectories, and the searchSubdirectories flag is passed through recursion but never checked. It also covers the fix, the INI CRC check, the callers that pass FALSE, and the WorldBuilder and replay tests. It relates directly to the changeset.

Warning

Some tools did not complete. Review the errors below.

Clang (23.1.4)

Core/GameEngine/Source/Common/System/ArchiveFile.cpp

Clang-Tidy produced no recognizable diagnostics; analysis is incomplete

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 77d18889-f31c-46d6-8752-3d3f0cb5a7da
Commits

Reviewing files that changed from the base of the PR and between 6130948 and 43e9148.

Files selected for processing: 1

  • Core/GameEngine/Source/Common/System/ArchiveFile.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@tintinhamans
tintinhamans marked this pull request as ready for review October 10, 2026 04:46
@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

ArchiveFile::getFileListInDirectory now respects searchSubdirectories.

  • Archive searches only enter nested folders when asked.

Reviews (4) · Last reviewed commit: "fix(filesystem): Only list archive subdi..." · Reviewed by Greptile

@tintinhamans
tintinhamans force-pushed the arctic/fix/archive-list-subdirectories branch from 0dbc893 to 99b6064 Compare October 10, 2026 08:19
@tintinhamans
tintinhamans marked this pull request as draft October 11, 2026 15:15
@tintinhamans
tintinhamans force-pushed the arctic/fix/archive-list-subdirectories branch from 99b6064 to 6130948 Compare October 18, 2026 13:19
@tintinhamans
tintinhamans marked this pull request as ready for review October 18, 2026 13:19

@Skyaero42 Skyaero42 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple. Looks good

@xezon xezon changed the title fix(filesystem): Only list archive subdirectories when asked fix(archivefile): Only list archive subdirectories in ArchiveFile::getFileListInDirectory() when asked Oct 19, 2026
@xezon xezon changed the title fix(archivefile): Only list archive subdirectories in ArchiveFile::getFileListInDirectory() when asked fix(archivefile): Only list archive subdirectories when asked Oct 19, 2026

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@stephanmeesters

Copy link
Copy Markdown

Looks like this can be merged

@stephanmeesters
stephanmeesters force-pushed the arctic/fix/archive-list-subdirectories branch from 6130948 to 43e9148 Compare November 28, 2026 12:37
@stephanmeesters

Copy link
Copy Markdown

Look the liberty to rebase it

@stephanmeesters
stephanmeesters merged commit 0f43d37 into TheSuperHackers:main Nov 28, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants