Skip to content

bugfix(worldbuilder): Create boundaries only when dragging - #3455

Draft
OmarAglan wants to merge 1 commit into
TheSuperHackers:mainfrom
OmarAglan:bugfix/worldbuilder-boundary-click
Draft

OmarAglan wants to merge 1 commit into
TheSuperHackers:mainfrom
OmarAglan:bugfix/worldbuilder-boundary-click

Conversation

@OmarAglan

Copy link
Copy Markdown

Addresses the accidental boundary findings raised on #3383 and #3384.

Clicking empty space previously inserted a boundary at {1,1} immediately. Releasing without dragging left it in the map.

Defer creation until the pointer moves from its mouse-down position. Create the boundary at the drag position, then update it during the same drag. A click or a mouse-move notification at the unchanged position leaves the boundary list untouched. Apply the same change to both editors.

This addresses uncompleted clicks. It does not add undo support for completed boundary edits.

Validation:

  • Reproduced the original {1,1} boundary left by an empty click in both source copies.
  • Passed 52 gesture assertions per editor covering clicks, unchanged-position notifications, repeated gestures, dragging, existing handles, other mouse buttons, and negative coordinates.
  • All 16 actual-source VC6 compilations passed for the heightmap/border source matrix: both games, debug/release, DATA=0/1.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T16:15:34.716020Z 9f1801b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6ad9481f-2516-4e3f-af8c-d8dd21114507

📥 Commits

Reviewing files that changed from the base of the PR and between 2119cc9 and 9f1801b.


📒 Files selected for processing (4)
  • Generals/Code/Tools/WorldBuilder/include/BorderTool.h
  • Generals/Code/Tools/WorldBuilder/src/BorderTool.cpp
  • GeneralsMD/Code/Tools/WorldBuilder/include/BorderTool.h
  • GeneralsMD/Code/Tools/WorldBuilder/src/BorderTool.cpp

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



Walkthrough

BorderTool now waits for pointer movement before creating a boundary. It ignores movement at the original click point, clamps converted coordinates to zero or greater, and updates the created boundary during later movement. Both WorldBuilder variants use this behavior.

Changes

Border creation

Layer / File(s) Summary
Track border-creation state
Generals/Code/Tools/WorldBuilder/include/BorderTool.h, GeneralsMD/Code/Tools/WorldBuilder/include/BorderTool.h, Generals/Code/Tools/WorldBuilder/src/BorderTool.cpp, GeneralsMD/Code/Tools/WorldBuilder/src/BorderTool.cpp
Both variants track the mouse-down point and whether a boundary has been created. Mouse-down starts border creation without inserting an initial boundary.
Create and update boundaries
Generals/Code/Tools/WorldBuilder/src/BorderTool.cpp, GeneralsMD/Code/Tools/WorldBuilder/src/BorderTool.cpp
The first eligible movement creates a boundary. Later movements update it. Mouse-up resets the creation flag.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 9f180

A click without dragging leaves the boundary list unchanged, including after the button is released. No merge-blocking issue remains.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: boundaries are created only during dragging.
Description check Passed The description directly explains the accidental boundary issue, the deferred creation behavior, scope across both editors, and validation results.
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.


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Both WorldBuilder editors now wait for pointer movement before creating a boundary.

  • New map boundaries appear only after the pointer moves.

OmarAglan explicitly deferred undo support for completed boundary edits.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Left press in empty space] --> B[Remember pointer position]
  B --> C{Pointer position changed?}
  C -->|No| D[Leave boundaries unchanged]
  C -->|Yes| E[Create boundary at drag position]
  E --> F[Update boundary on later moves]
  D --> G[Release clears gesture]
  F --> G
Loading

Reviews (1) · Last reviewed commit: "bugfix(worldbuilder): Create boundaries ..." · Reviewed by Greptile

@OmarAglan
OmarAglan marked this pull request as draft October 9, 2026 16:16
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.

1 participant