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

On Mon, 3 Sep 2007 17:12:58 -0700 Egor Vyscrebentsov wrote:

> Version 2 of patch. Working, looks not so awful.

All had been written before us - helpdata.c#insert_requirement()

Double "\n\n" at the end of every req line looks not good though.
I suggest to remove one. (At trunk, at least.)

_This_ patch is ready for inclusion into S2_1, however.

PS. I want to resurrect an old good tradition of "commiting patch
by not an author", so I'm not going to commit this patch myself.

-- 
Thanks, evyscr

Index: client/helpdata.c
===================================================================
--- client/helpdata.c	(revision 13508)
+++ client/helpdata.c	(working copy)
@@ -645,6 +645,7 @@
     .type = REQ_BUILDING,
     .value = {.building = which}
   };
+  bool has_req = FALSE;
 
   assert(buf);
   buf[0] = '\0';
@@ -655,11 +656,24 @@
   }
 
   imp = improvement_by_number(which);
-  
+
   if (imp->helptext && imp->helptext[0] != '\0') {
     cat_snprintf(buf, bufsz, "%s\n\n", _(imp->helptext));
   }
 
+  requirement_vector_iterate(&imp->reqs, preq) {
+    insert_requirement(preq, buf, bufsz);
+    has_req = TRUE;
+  } requirement_vector_iterate_end;
+
+#if 0
+  if (has_req) {
+    cat_snprintf(buf, bufsz, "\n");
+  } else {
+/*    cat_snprintf(buf, bufsz, _("Requires: Nothing\n\n"));*/
+  }
+#endif
+
   if (tech_exists(improvement_by_number(which)->obsolete_by)) {
     cat_snprintf(buf, bufsz,
 		 _("* The discovery of %s will make %s obsolete.\n"),
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to