Author: jtn
Date: Fri Mar 11 00:46:05 2016
New Revision: 32225

URL: http://svn.gna.org/viewcvs/freeciv?rev=32225&view=rev
Log:
Don't try to explain any effect with any present=FALSE requirements in
autogenerated government help.
Also suppress help for any effect with quiet=TRUE requirements.
This removes a lot of lies from government help (notably, in civ2civ3)
that were provoked by the deprecation of nreqs.

See gna bug #23256.

Modified:
    trunk/client/helpdata.c

Modified: trunk/client/helpdata.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/helpdata.c?rev=32225&r1=32224&r2=32225&view=diff
==============================================================================
--- trunk/client/helpdata.c     (original)
+++ trunk/client/helpdata.c     Fri Mar 11 00:46:05 2016
@@ -5189,14 +5189,17 @@
     struct strvec *outputs = strvec_new();
     struct astring outputs_or = ASTRING_INIT;
     struct astring outputs_and = ASTRING_INIT;
-    bool extra_reqs = FALSE;
+    bool too_complex = FALSE;
     bool world_value_valid = TRUE;
 
     /* Grab output type, if there is one */
     requirement_vector_iterate(&peffect->reqs, preq) {
-      /* FIXME: perhaps we should treat any effect with negated requirements
-       * as too complex for us to explain here? */
-      if (!preq->present) {
+      /* Treat an effect with any negated requirements as too complex for
+       * us to explain here.
+       * Also don't try to explain an effect with any requirements explicitly
+       * marked as 'quiet' by ruleset author. */
+      if (!preq->present || preq->quiet) {
+        too_complex = TRUE;
         continue;
       }
       switch (preq->source.kind) {
@@ -5228,7 +5231,7 @@
            /* Already have a unit flag requirement. More than one is too
             * complex for us to explain, so say nothing. */
            /* FIXME: we could handle this */
-           extra_reqs = TRUE;
+           too_complex = TRUE;
          }
          break;
        case VUT_GOVERNMENT:
@@ -5238,13 +5241,13 @@
          fc_assert(preq->source.value.govern == gov);
          break;
        default:
-         extra_reqs = TRUE;
+         too_complex = TRUE;
          world_value_valid = FALSE;
          break;
       };
     } requirement_vector_iterate_end;
 
-    if (!extra_reqs) {
+    if (!too_complex) {
       /* Only list effects that don't have extra requirements too complex
        * for us to handle.
        * Anything more complicated will have to be documented by hand by the


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

Reply via email to