Author: jtn Date: Fri Mar 11 01:06:03 2016 New Revision: 32227 URL: http://svn.gna.org/viewcvs/freeciv?rev=32227&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: branches/S2_6/client/helpdata.c Modified: branches/S2_6/client/helpdata.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/helpdata.c?rev=32227&r1=32226&r2=32227&view=diff ============================================================================== --- branches/S2_6/client/helpdata.c (original) +++ branches/S2_6/client/helpdata.c Fri Mar 11 01:06:03 2016 @@ -5102,14 +5102,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) { @@ -5141,7 +5144,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: @@ -5151,13 +5154,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