Author: mir3x
Date: Mon Jan 16 13:44:57 2017
New Revision: 34838

URL: http://svn.gna.org/viewcvs/freeciv?rev=34838&view=rev
Log:
quickselect - return focused unit before unit count check for SELECT_FOCUS

See bug #25425


Modified:
    branches/S3_0/client/control.c
    branches/S3_0/client/gui-qt/mapctrl.cpp

Modified: branches/S3_0/client/control.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/control.c?rev=34838&r1=34837&r2=34838&view=diff
==============================================================================
--- branches/S3_0/client/control.c      (original)
+++ branches/S3_0/client/control.c      Mon Jan 16 13:44:57 2017
@@ -2758,6 +2758,10 @@
 
   fc_assert_ret_val(qtype > SELECT_POPUP, NULL);
 
+  if (qtype == SELECT_FOCUS) {
+    return head_of_units_in_focus();
+  }
+
   if (listsize == 0) {
     return NULL;
   } else if (listsize == 1) {
@@ -2765,9 +2769,6 @@
     return (unit_owner(punit) == client.conn.playing) ? punit : NULL;
   }
 
-  if (qtype == SELECT_FOCUS) {
-    return head_of_units_in_focus();
-  }
   /*  Quickselect priorities. Units with moves left
    *  before exhausted. Focus unit is excluded.
    *

Modified: branches/S3_0/client/gui-qt/mapctrl.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-qt/mapctrl.cpp?rev=34838&r1=34837&r2=34838&view=diff
==============================================================================
--- branches/S3_0/client/gui-qt/mapctrl.cpp     (original)
+++ branches/S3_0/client/gui-qt/mapctrl.cpp     Mon Jan 16 13:44:57 2017
@@ -387,7 +387,7 @@
   }
   sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON);
   if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
-    if (goto_is_active() == false && pcity == nullptr) {
+    if (goto_is_active() == false) {
       action_button_pressed(pos.x(), pos.y(), SELECT_FOCUS);
     }
     return;


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to