Author: jtn
Date: Tue Apr  7 09:25:07 2015
New Revision: 28738

URL: http://svn.gna.org/viewcvs/freeciv?rev=28738&view=rev
Log:
Automatically document things allowed/prevented by extras/nations.

See gna patch #5984.

Modified:
    trunk/client/helpdata.c

Modified: trunk/client/helpdata.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/helpdata.c?rev=28738&r1=28737&r2=28738&view=diff
==============================================================================
--- trunk/client/helpdata.c     (original)
+++ trunk/client/helpdata.c     Tue Apr  7 09:25:07 2015
@@ -3269,7 +3269,6 @@
                   "to build %s units.\n"),
                  advance_name_translation(u->require_advance),
                 utype_name_translation(u));
-    cat_snprintf(buf, bufsz, "  ");
   }
 
   insert_allows(&source, buf + strlen(buf), bufsz - strlen(buf));
@@ -4491,6 +4490,10 @@
 {
   struct base_type *pbase;
   struct road_type *proad;
+  struct universal source = {
+    .kind = VUT_EXTRA,
+    .value = {.extra = pextra}
+  };
 
   fc_assert_ret(NULL != buf && 0 < bufsz);
   buf[0] = '\0';
@@ -4517,6 +4520,8 @@
       cat_snprintf(buf, bufsz, "%s\n\n", _(text));
     } strvec_iterate_end;
   }
+
+  insert_allows(&source, buf + strlen(buf), bufsz - strlen(buf));
 
   if (is_extra_caused_by(pextra, EC_POLLUTION)) {
     CATLSTR(buf, bufsz,
@@ -5459,6 +5464,11 @@
 void helptext_nation(char *buf, size_t bufsz, struct nation_type *pnation,
                     const char *user_text)
 {
+  struct universal source = {
+    .kind = VUT_NATION,
+    .value = {.nation = pnation}
+  };
+
   fc_assert_ret(NULL != buf && 0 < bufsz);
   buf[0] = '\0';
 
@@ -5579,8 +5589,15 @@
     astr_free(&list);
   }
 
+  if (buf[0] != '\0') {
+    CATLSTR(buf, bufsz, "\n");
+  }
+  insert_allows(&source, buf + strlen(buf), bufsz - strlen(buf));
+
   if (user_text && user_text[0] != '\0') {
-    CATLSTR(buf, bufsz, "\n");
+    if (buf[0] != '\0') {
+      CATLSTR(buf, bufsz, "\n");
+    }
     CATLSTR(buf, bufsz, user_text);
   }
 }


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

Reply via email to