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

Jason Dorje Short wrote:
> SDL client, but it probably happens on any client.  If the text.c 
> function gets called for an unknown tile then ptile->terrain is NULL.
> 
No, it doesn't!!!  Which you would have known had you bothered to check!!!
That's a *BUG* in the SDL client!!!

===

client/gui-gtk-2.0/mapctrl.c:120:
   if (client_tile_get_known(ptile) >= TILE_KNOWN_FOGGED) {


client/gui-win32/mapctrl.c:129:
   if (client_tile_get_known(ptile) < TILE_KNOWN_FOGGED)
     return;


client/gui-xaw/mapctrl.c:109:
   if (client_tile_get_known(ptile)>=TILE_KNOWN_FOGGED) {

===

Furthermore, I've been told for many months not to add new translated
strings to 2.1.

Worse, this length of text is completely out of scale for the popup!

Worst, you stuck it before the debug data, instead of next to the rest of
the terrain text, ruining *all* existing clients to fix a bug in SDL.

Finally, you did it to all branches, without waiting for review.

I'm immediately replacing your patch, to at least use an existing string,
and not screw up the entire project on a commonly seen tile just days
before another release.

But fixing the SDL client bug itself would be best....

===

Committed S2_1 revision 13953.
Committed S2_2 revision 13954.
Committed trunk revision 13955.

Index: client/text.c
===================================================================
--- client/text.c       (revision 13952)
+++ client/text.c       (working copy)
@@ -95,17 +95,15 @@
   static struct astring str = ASTRING_INIT;
 
   astr_clear(&str);
-  if (client_tile_get_known(ptile) == TILE_UNKNOWN) {
-    /* TRANS: This text is shown on middle-click of an unknown tile */
-    astr_add(&str, _("Unknown tile:\n"
-                    "you must explore this tile to\n"
-                    "gain information about it."));
-    return str.str;
-  }
 #ifdef DEBUG
   astr_add_line(&str, _("Location: (%d, %d) [%d]"), 
                ptile->x, ptile->y, ptile->continent); 
 #endif /*DEBUG*/
+
+  if (client_tile_get_known(ptile) == TILE_UNKNOWN) {
+    astr_add(&str, _("Unknown"));
+    return str.str;
+  }
   astr_add_line(&str, _("Terrain: %s"),  tile_get_info_text(ptile));
   astr_add_line(&str, _("Food/Prod/Trade: %s"),
                get_tile_output_text(ptile));
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to