Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review. WalkthroughThe Generals and GeneralsMD WorldBuilder variants now detect cliff-state bytes beyond the legacy serialized row width. Document saves are rejected with an error, autosaves are skipped, and direct height-map serialization throws before writing chunks when such bytes are present. ChangesCliff-state save validation
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable issue remains in the supplied review evidence; the change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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. Comment |
|
| if (m_heightMap && !m_heightMap->canSaveCliffState()) { | ||
| return; |
There was a problem hiding this comment.
Autosave reports false success
When canSaveCliffState() rejects a map, autoSave() returns without saving, but CMainFrame::OnTimer() still displays “Auto Save Complete.” Later attempts repeat that message while the backups stay unchanged. Return a save result and show a skipped-save message when cliff flags cannot be stored. Apply this to both source copies.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e4430b82a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { | ||
| if (m_heightMap && !m_heightMap->canSaveCliffState()) { | ||
| ::AfxMessageBox("Cannot save: the retail Generals map format cannot store cliff flags at the right edge of this map. Adjust the map width before saving."); | ||
| return FALSE; |
There was a problem hiding this comment.
Abort Jump to Game after rejecting the save
When an existing retail Generals map with a nonzero omitted cliff byte is launched through Ctrl+J, this new FALSE return reaches OnJumpToGame, whose call to DoFileSave() at line 620 ignores the result and still executes _spawnl at line 628. The editor therefore launches the previous on-disk map immediately after reporting that the current state cannot be saved, so a playtest can run against stale terrain; make that caller abort when the save fails.
Useful? React with 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Addresses the cliff-state save findings raised on #3383 and #3384.
The retail Generals BlendTileData v7 format writes a shorter cliff-state row for some map widths. Nonzero flags in the omitted byte are lost when the map is reopened.
Reject saves that would lose these flags. Save and Save As validate before opening or replacing a file. Autosave validates before rotating backups and leaves the pending-autosave state set. The writer also rejects the map before writing any chunks.
Retail-compatible Generals still writes v7. Zero Hour and Generals without RETAIL_COMPATIBLE_DATA retain v8 behavior. Both source copies receive the same changes.
Validation: