Skip to content

Reimplement stockpile footprint cleanup (native byte match) - #217

Open
Krarilotus wants to merge 5 commits into
sourcehold:mainfrom
Krarilotus:reimplement/stockpile-footprint-cleanup
Open

Krarilotus wants to merge 5 commits into
sourcehold:mainfrom
Krarilotus:reimplement/stockpile-footprint-cleanup

Conversation

@Krarilotus

@Krarilotus Krarilotus commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

TL;DR: Recreates the original cleanup of a stockpile's nine walkable tiles, including the building's rubble behavior. The implementation uses existing map and building structures and matches the original function at 100% in reccmp.

Reimplements TileMapState::clearStockpileFootprintTiles at 0x004FAF70. Each tile loses the existing L_STOCKPILEUnk and L_WALL_OR_GATEHOUSE logic flags, regains its default height, follows its referenced building's noRubble branch, and finally clears AlphaGFXLayer.

MiscDisplayLayer is a separate ushort layer without a corresponding flag enum in the current headers. Its 0x4000 value remains literal until its meaning is identified. The wiki documents this limitation and the ownership of the map layers and global inputs.

Validation: full x86 RelWithDebInfo DLL build with VS2005 SP1 passes after the flag-name change; linked reccmp still reports 100% at 0x004FAF70. The local build uses a current Windows SDK manifest tool because the legacy tool crashes. No DLL deployment or gameplay test was performed. The emulation script was removed from this PR as requested in review.

Comment thread tools/verification/verify_stockpile_cleanup.py Outdated
Comment thread src/OpenSHC/Map/TileMapState/clearStockpileFootprintTiles.cpp Outdated
Comment thread src/OpenSHC/Map/TileMapState/clearStockpileFootprintTiles.cpp
Comment thread docs/wiki/stockpile-footprint-cleanup.md Outdated
Comment thread src/OpenSHC/Map/TileMapState/clearStockpileFootprintTiles.cpp
@Krarilotus

Copy link
Copy Markdown
Contributor Author

Renamed the article to game-mechanics/stockpile.md so its title covers both placement and cleanup, and linked it from the wiki overview. The game-mechanics directory also gives these gameplay articles a place outside the wiki root. Sphinx generated the renamed page and link; no implementation code changed.

@TheRedDaemon

Copy link
Copy Markdown
Contributor

@Krarilotus LGTM

Please resolve the conflict. We usually do this via rebasing, basically, if you are on your branch, you would rebase on "main" and force push the result onto your branch.

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.

2 participants