<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40431 >

 Use get_base_by_gui_type() instead of hardcoded base type index.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/gui-sdl/menu.c 
freeciv/client/gui-sdl/menu.c
--- freeciv/client/gui-sdl/menu.c       2008-03-08 16:33:05.000000000 +0200
+++ freeciv/client/gui-sdl/menu.c       2008-08-12 16:29:38.000000000 +0300
@@ -1134,6 +1134,8 @@
          pOrder_Mine_Button->theme = pTheme->OPlantForest_Icon;
    
    } else {
+     struct base_type *pbase;
+
          /* set Mining Icon */
          my_snprintf(cBuf, sizeof(cBuf),"%s (%s) %d %s",
                        _("Build Mine"), "M", time , 
@@ -1160,7 +1162,8 @@
        set_wflag(pOrder_Transform_Button, WF_HIDDEN);
       }
 
-      if (!pCity && can_unit_do_activity_base(pUnit, BASE_FORTRESS)) {
+      pbase = get_base_by_gui_type(BASE_GUI_FORTRESS, pUnit, pUnit->tile);
+      if (!pCity && pbase) {
        local_show(ID_UNIT_ORDER_FORTRESS);
       } else {
        local_hide(ID_UNIT_ORDER_FORTRESS);
@@ -1172,7 +1175,8 @@
        local_hide(ID_UNIT_ORDER_FORTIFY);
       }
 
-      if (!pCity && can_unit_do_activity_base(pUnit, BASE_AIRBASE)) {
+      pbase = get_base_by_gui_type(BASE_GUI_AIRBASE, pUnit, pUnit->tile);
+      if (!pCity && pbase) {
        local_show(ID_UNIT_ORDER_AIRBASE);
       } else {
        local_hide(ID_UNIT_ORDER_AIRBASE);
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to