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

 Tile popup shows bases only if there is also other kind of
infrastructure on tile. Fix attached.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/text.c freeciv/client/text.c
--- freeciv/client/text.c       2008-08-23 14:59:54.000000000 +0300
+++ freeciv/client/text.c       2008-09-02 01:08:29.000000000 +0300
@@ -221,6 +221,14 @@
     } unit_list_iterate_end;
   }
   infra = get_tile_infrastructure_set(ptile, &infracount);
+  if (infracount == 0) {
+    base_type_iterate(pbase) {
+      if (BV_ISSET(ptile->bases, base_index(pbase))) {
+        infracount = 1;
+        break;
+      }
+    } base_type_iterate_end;
+  }
   if (infracount > 0) {
     astr_add_line(&str, _("Infrastructure: %s"),
                  get_infrastructure_text(ptile->special, ptile->bases));
@@ -759,6 +767,14 @@
       get_tile_infrastructure_set(punit->tile, &infracount);
 
     astr_add_line(&str, "%s", tile_get_info_text(punit->tile, linebreaks));
+    if (infracount == 0) {
+      base_type_iterate(pbase) {
+        if (BV_ISSET(punit->tile->bases, base_index(pbase))) {
+          infracount = 1;
+          break;
+        }
+      } base_type_iterate_end;
+    }
     if (infracount > 0) {
       astr_add_line(&str, "%s", get_infrastructure_text(infrastructure, 
punit->tile->bases));
     } else {
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to