Repository navigation
A click on a plot without one's units keeps the selected unit - #171
Open
MortenLyhr wants to merge 1 commit into
Open
MortenLyhr wants to merge 1 commit into
MortenLyhr wants to merge 1 commit into
Conversation
With a unit selected, the original's left click on a bare plot, on one's own empty city or on a foreign unit's plot keeps the unit selected (Wine, BUG + BULL, backlog bssth#99); the camera still goes to the plot. OpenCiv4 dropped the selection. A click there now leaves the selection as it is; one on one's own units still selects them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clean room (#181): checked on 2026-11-25 against #181's clean-room rules and guides (
CONTRIBUTING.md"Clean room",AGENTS.md). This PR was written before #181; its sources are below, in #181's terms.What it is based on: clicks with a unit selected in the original under Wine (BtS 3.19, BUG + BULL, batch 3, with the plot under the mouse logged).
strings), and nothing here comes from someone else's (CONTRIBUTING)The problem
With a unit selected, a left click on a plot with none of your units dropped the selection: a bare plot, your own empty city, or a foreign unit's plot. The next right click then did nothing.
What the original does (Wine, BUG + BULL)
Seen in Wine batch 3 (backlog #99). A lone warrior is selected at 81,65, and the plot under the mouse is logged to show where each click lands. One left click on each of these keeps the warrior selected (
head WARRIOR n 1):The camera glides to the bare plot and the Viking plot, but not to our city. The click on our city opens no city screen.
What it changes
main.cpp, the map's left click: when the plot has none of your units, the selection now stays as it is. Theelse ui.clearSelectionList()is gone. A click on your own units still selects them, and the camera rule is unchanged (it already matches).On master, a single click on your own city still opens its city screen, before this code is reached. That is the original's double click, and #149 changes it (backlog #46). With #149, a single click on your own empty city reaches this code and keeps the unit, as in Wine (checked below).
How it was checked
OpenCiv4 (BUG + BULL, the test map, batch 3's setup
testgames/shots/batch3/b3-setup.pywith the lone warrior selected byo-lone.py,--keys "~...<x,y>...."):head - n 0)head WARRIOR … n 1)ctest 15/15. Sync checksums equal master's on all 100 turns (
D7D43800): interface only.Pictures
Before: Wine | OpenCiv4 (from batch 3)
After (OpenCiv4, this PR): the warrior stays selected.
Own empty city, with #150 (which holds #149's double click) and this commit: the warrior stays selected, no city screen.
🤖 Generated with Claude Code