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

2008/8/12 Marko Lindqvist:
>
>  Use get_base_by_gui_type() instead of hardcoded base type index.

 - Fixed compile


 - 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-08-13 15:42:16.000000000 +0300
+++ freeciv/client/gui-sdl/menu.c       2008-08-14 00:56:50.000000000 +0300
@@ -1005,6 +1005,7 @@
       struct tile *pTile = pUnit->tile;
       struct city *pCity = tile_city(pTile);
       struct terrain *pTerrain = tile_terrain(pTile);
+      struct base_type *pbase;
       
       if (!counter) {
        local_show(ID_UNIT_ORDER_GOTO);
@@ -1160,7 +1161,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 +1174,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