Conversation
Align WorldHeightMapEdit and BorderTool with Zero Hour. Preserve Generals BlendTileData v7 row packing under RETAIL_COMPATIBLE_DATA, adopt the wider in-memory flag rows, and inherit the shared raw-tile accessor. Keep tile indices valid when the copied base blend cannot be allocated, and handle the optional boundary output on a miss.
Move the aligned WHeightMapEdit and BorderTool header/source pairs with unify_move_files.py. Compile the shared sources through corei_worldbuilder in each game's existing WorldBuilder target.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. WalkthroughThe build configuration adds a Core WorldBuilder target and links it to the Generals and Zero Hour tools. The changes also update height-map editing behavior and remove the BorderTool implementation and declarations. ChangesWorldBuilder Core Migration
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Suggested reviewers: Merge Risk: 🟡 Moderate · up to Terrain editing near the blend-record limit can consume a slot without applying the edit. Make the allocations transactional before merging. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Both editors continue to save maps through their existing document flows, and the reviewed file-format change matches the available reader. No new security exposure was established. Coverage of other consumers and runtime behavior remains incomplete. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
|
| Short newBaseNdx = findOrCreateBlendTile(&tempBlendTileInfo); | ||
| if (newBaseNdx < 0) { | ||
| return; |
There was a problem hiding this comment.
Unused blend consumes final slot When a three-way blend needs a flipped base copy and only one blend-table slot remains, the secondary blend takes that slot first. Creating the base copy then fails, so the function returns without assigning the secondary to a cell. The unused record keeps the slot occupied, preventing a later blend from using it.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 7110ebec-9419-478b-87ed-b4b5e144e523
📒 Files selected for processing (13)
Core/Tools/CMakeLists.txtCore/Tools/WorldBuilder/CMakeLists.txtCore/Tools/WorldBuilder/include/BorderTool.hCore/Tools/WorldBuilder/include/WHeightMapEdit.hCore/Tools/WorldBuilder/src/BorderTool.cppCore/Tools/WorldBuilder/src/WHeightMapEdit.cppGenerals/Code/Tools/WorldBuilder/CMakeLists.txtGenerals/Code/Tools/WorldBuilder/include/BorderTool.hGenerals/Code/Tools/WorldBuilder/include/WHeightMapEdit.hGenerals/Code/Tools/WorldBuilder/src/BorderTool.cppGenerals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cppGeneralsMD/Code/Tools/WorldBuilder/CMakeLists.txtscripts/cpp/unify_move_files.py
💤 Files with no reviewable changes (3)
- Generals/Code/Tools/WorldBuilder/include/BorderTool.h
- Generals/Code/Tools/WorldBuilder/src/BorderTool.cpp
- Generals/Code/Tools/WorldBuilder/include/WHeightMapEdit.h
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| Short newBaseNdx = findOrCreateBlendTile(&tempBlendTileInfo); | ||
| if (newBaseNdx < 0) { | ||
| return; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
rg -n 'findOrCreateBlendTile|m_numBlendTiles|MAX_BLEND|tempBlendTileInfo' Core/Tools/WorldBuilder/src/WHeightMapEdit.cpp
sed -n '1120,1210p' Core/Tools/WorldBuilder/src/WHeightMapEdit.cppRepository: TheSuperHackers/GeneralsGameCode
Length of output: 4552
Do not retain the secondary blend record when primary allocation fails.
If the blend-record capacity is nearly exhausted, findOrCreateBlendTile(&blendInfo) can allocate a new secondary record. The subsequent findOrCreateBlendTile(&tempBlendTileInfo) can then return -1. The early return leaves the secondary record unreferenced and consumes a blend-record slot.
Make the two allocations transactional, or roll back the secondary record created by this call when primary allocation fails.
This PR align
WorldHeightMapEditandBorderToolwith Zero Hour, and moves their headers and sources to Core.Both WorldBuilder targets compile the shared sources through
corei_worldbuilder.Generals Gets
Explain some points
The duplicate
WorldHeightMapEdit::getRawTileData()is removed because the public base class implementation is identical and already used by Zero Hour.also Generals still writes BlendTileData v7 with
RETAIL_COMPATIBLE_DATA, packing each row to the legacy width. Other configurations write v8, that is the only game specific compatibility guard added here.The shared blend path checks whether the copied base blend could be allocated before updating tile indices. Boundary lookup also checks its optional handle pointer when reporting a miss.
The alignment and mechanical move are separate commits for review.
Validation:
Codex assisted with the compatibility analysis, local validation.