Author: cazfi Date: Sun Feb 1 07:34:23 2015 New Revision: 27921 URL: http://svn.gna.org/viewcvs/freeciv?rev=27921&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: trunk/client/gui-gtk-2.0/unitselect.c trunk/client/gui-gtk-3.0/unitselect.c Modified: trunk/client/gui-gtk-2.0/unitselect.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-2.0/unitselect.c?rev=27921&r1=27920&r2=27921&view=diff ============================================================================== --- trunk/client/gui-gtk-2.0/unitselect.c (original) +++ trunk/client/gui-gtk-2.0/unitselect.c Sun Feb 1 07:34:23 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: trunk/client/gui-gtk-3.0/unitselect.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/unitselect.c?rev=27921&r1=27920&r2=27921&view=diff ============================================================================== --- trunk/client/gui-gtk-3.0/unitselect.c (original) +++ trunk/client/gui-gtk-3.0/unitselect.c Sun Feb 1 07:34:23 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