Author: cazfi
Date: Sat Apr 30 22:21:47 2016
New Revision: 32528

URL: http://svn.gna.org/viewcvs/freeciv?rev=32528&view=rev
Log:
Send translated unit name in unit link, not untranslated one. Client shows this 
if
unit has already dead (or otherwise not visible on client) when the link is 
received.

Reported by fomalhaut

See bug #24608

Modified:
    trunk/common/featured_text.c

Modified: trunk/common/featured_text.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/featured_text.c?rev=32528&r1=32527&r2=32528&view=diff
==============================================================================
--- trunk/common/featured_text.c        (original)
+++ trunk/common/featured_text.c        Sat Apr 30 22:21:47 2016
@@ -454,7 +454,7 @@
             return FALSE;
           }
           ptag->link.id = punit->id;
-          sz_strlcpy(ptag->link.name, unit_rule_name(punit));
+          sz_strlcpy(ptag->link.name, unit_name_translation(punit));
         }
         return TRUE;
       };
@@ -532,7 +532,7 @@
           if (punit) {
             ret += fc_snprintf(buf + ret, len - ret,
                                " id=%d name=\"%s\"",
-                               punit->id, unit_rule_name(punit));
+                               punit->id, unit_name_translation(punit));
           } else {
             ret += fc_snprintf(buf + ret, len - ret,
                                " id=%d", ptag->link.id);
@@ -1113,12 +1113,10 @@
 {
   static char buf[MAX_LEN_LINK];
 
-  /* We use the rule name of the unit, it will be translated in every
-   * local sides in the function text_tag_replace_text(). */
   fc_snprintf(buf, sizeof(buf), "%c%s tgt=\"%s\" id=%d name=\"%s\" %c%c",
               SEQ_START, text_tag_type_short_name(TTT_LINK),
               text_link_type_name(TLT_UNIT), punit->id,
-              unit_rule_name(punit), SEQ_END, SEQ_STOP);
+              unit_name_translation(punit), SEQ_END, SEQ_STOP);
   return buf;
 }
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to