Author: jtn
Date: Tue Jun 17 11:07:24 2014
New Revision: 25174

URL: http://svn.gna.org/viewcvs/freeciv?rev=25174&view=rev
Log:
Fix help not to suppress veteran information for NoVeteran units (since
they may become veteran by other means than experience).

See gna bug #22201.

Modified:
    trunk/client/helpdata.c

Modified: trunk/client/helpdata.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/helpdata.c?rev=25174&r1=25173&r2=25174&view=diff
==============================================================================
--- trunk/client/helpdata.c     (original)
+++ trunk/client/helpdata.c     Tue Jun 17 11:07:24 2014
@@ -2726,7 +2726,7 @@
 char *helptext_unit(char *buf, size_t bufsz, struct player *pplayer,
                    const char *user_text, struct unit_type *utype)
 {
-  bool can_be_veteran;
+  bool has_vet_levels;
   int flagid;
 
   fc_assert_ret_val(NULL != buf && 0 < bufsz && NULL != user_text, NULL);
@@ -2737,8 +2737,7 @@
     return buf;
   }
 
-  can_be_veteran = !utype_has_flag(utype, UTYF_NO_VETERAN)
-    && utype_veteran_levels(utype) > 1;
+  has_vet_levels = utype_veteran_levels(utype) > 1;
 
   buf[0] = '\0';
 
@@ -3277,8 +3276,8 @@
                    action_prepare_ui_name(act, "", ""));
     }
   } action_iterate_end;
-  if (!can_be_veteran) {
-    /* Only mention this if the game generally has veteran levels. */
+  if (!has_vet_levels) {
+    /* Only mention this if the game generally does have veteran levels. */
     if (game.veteran->levels > 1) {
       CATLSTR(buf, bufsz, _("* Will never achieve veteran status.\n"));
     }
@@ -3293,7 +3292,8 @@
 #endif
     /* FIXME: if we knew the raise chances on the client, we could be
      * more specific here about whether veteran status can be acquired
-     * through combat/missions/work. */
+     * through combat/missions/work. Should also take into account
+     * UTYF_NO_VETERAN when writing this text. (Gna patch #4794) */
     CATLSTR(buf, bufsz, _("* May acquire veteran status.\n"));
     if (utype_veteran_has_power_bonus(utype)) {
       if ((!utype_has_flag(utype, UTYF_NUCLEAR) && utype->attack_strength > 0)
@@ -3322,7 +3322,7 @@
   if (strlen(buf) > 0) {
     CATLSTR(buf, bufsz, "\n");
   }
-  if (can_be_veteran && utype->veteran) {
+  if (has_vet_levels && utype->veteran) {
     /* The case where the unit has only a single veteran level has already
      * been handled above, so keep quiet here if that happens */
     if (insert_veteran_help(buf, bufsz, utype->veteran,


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

Reply via email to