Author: cazfi
Date: Sun Feb  1 07:34:39 2015
New Revision: 27923

URL: http://svn.gna.org/viewcvs/freeciv?rev=27923&view=rev
Log:
Bind unit selection dialog to mapview center tile if opened without units in 
focus.
This is just an safety measure, it should not be possible to open the dialog 
without units
in focus.

See patch #5752

Modified:
    branches/S2_5/client/gui-gtk-2.0/unitselect.c
    branches/S2_5/client/gui-gtk-3.0/unitselect.c

Modified: branches/S2_5/client/gui-gtk-2.0/unitselect.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-gtk-2.0/unitselect.c?rev=27923&r1=27922&r2=27923&view=diff
==============================================================================
--- branches/S2_5/client/gui-gtk-2.0/unitselect.c       (original)
+++ branches/S2_5/client/gui-gtk-2.0/unitselect.c       Sun Feb  1 07:34:39 2015
@@ -324,9 +324,12 @@
     pdialog->ptile = ptile;
   } else if (pdialog->ptile == NULL) {
     struct unit *punit = head_of_units_in_focus();
+
     if (punit) {
       pdialog->ptile = unit_tile(punit);
       center_tile_mapcanvas(pdialog->ptile);
+    } else {
+      pdialog->ptile = get_center_tile_mapcanvas();
     }
   }
 }

Modified: branches/S2_5/client/gui-gtk-3.0/unitselect.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-gtk-3.0/unitselect.c?rev=27923&r1=27922&r2=27923&view=diff
==============================================================================
--- branches/S2_5/client/gui-gtk-3.0/unitselect.c       (original)
+++ branches/S2_5/client/gui-gtk-3.0/unitselect.c       Sun Feb  1 07:34:39 2015
@@ -322,9 +322,12 @@
     pdialog->ptile = ptile;
   } else if (pdialog->ptile == NULL) {
     struct unit *punit = head_of_units_in_focus();
+
     if (punit) {
       pdialog->ptile = unit_tile(punit);
       center_tile_mapcanvas(pdialog->ptile);
+    } else {
+      pdialog->ptile = get_center_tile_mapcanvas();
     }
   }
 }


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

Reply via email to