Add unit id to tooltips for debugging

Per Inge Mathisen <per-0/[email protected]> Sat, 19 Mar 2005 14:40:57 +0000 (GMT)
Newsgroups gmane.games.freeciv.ai
Message-ID <[email protected]>
In --enable-debug=yes games, this patch (committed) adds the unit ID of
the relevant unit to the map sidebar and the city dialog unit tooltip.

This is enormously helpful when using the /debug server command.

  - Per
aihint1.diff (text/plain, 834 B)
Index: client/text.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/text.c,v
retrieving revision 1.29
diff -u -r1.29 text.c
--- client/text.c	18 Mar 2005 11:26:24 -0000	1.29
+++ client/text.c	19 Mar 2005 14:37:46 -0000
@@ -395,6 +395,9 @@
   }
 
   add_line("%s", get_nearest_city_text(pcity_near, pcity_near_dist));
+#ifdef DEBUG
+  add_line("Unit ID: %d", punit->id);
+#endif
 
   RETURN;
 }
@@ -514,9 +517,17 @@
       add_line(" ");
     }
     if (pcity) {
+#ifdef DEBUG
+      add_line("%s (Unit ID %d)", pcity->name, punit->id);
+#else
       add_line("%s", pcity->name);
+#endif
     } else {
+#ifdef DEBUG
+      add_line("(Unit ID %d)", punit->id);
+#else
       add_line(" ");
+#endif
     }
   } else {
     add("\n\n\n");