<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!!!


   if (client_tile_get_known(ptile) >= TILE_KNOWN_FOGGED) {

   if (client_tile_get_known(ptile) < TILE_KNOWN_FOGGED)

   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;
-  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"),
Freeciv-dev mailing list

Reply via email to