Skip to content

Commit

Permalink
Fix selecting city worked tiles
Browse files Browse the repository at this point in the history
The GUI was reacting to each click twice: the first time for the mouse down
event and the second for mouse up (why we're using both for click-like actions
is beyond me). Make sure that we only use mouse down.

Closes longturn#933.
  • Loading branch information
lmoureaux committed Mar 19, 2022
1 parent 01abb04 commit c317d99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2787,7 +2787,8 @@ void do_map_click(struct tile *ptile, enum quickselect_type qtype)

auto near_pcity = is_any_city_dialog_open();
int city_x, city_y;
if (near_pcity && !cma_is_city_under_agent(near_pcity, NULL)
if (qtype == SELECT_FOCUS && near_pcity
&& !cma_is_city_under_agent(near_pcity, NULL)
&& can_client_issue_orders()
&& city_base_to_city_map(&city_x, &city_y, near_pcity, ptile)) {
if (NULL != tile_worked(ptile) && tile_worked(ptile) == near_pcity) {
Expand Down

0 comments on commit c317d99

Please sign in to comment.