Author: sveinung
Date: Wed Oct 19 14:20:40 2016
New Revision: 34178

URL: http://svn.gna.org/viewcvs/freeciv?rev=34178&view=rev
Log:
Clean up enablers after adding obligatory reqs.

Have action_enabler_obligatory_reqs_add() remove any requirements that
conflicts with the action's obligatory hard requirements it just added.
This, together with the automatic obligatory hard req appending already done
in action_enabler_obligatory_reqs_add(), makes ruledit's enabler action
changing produce valid enablers.

See patch #7842

Modified:
    trunk/common/actions.c

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=34178&r1=34177&r2=34178&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Wed Oct 19 14:20:40 2016
@@ -1127,6 +1127,10 @@
     }
   } obligatory_req_vector_iterate_end;
 
+  /* Remove anything that conflicts with the newly added reqs. */
+  requirement_vector_contradiction_clean(&enabler->actor_reqs);
+  requirement_vector_contradiction_clean(&enabler->target_reqs);
+
   /* Sanity check: obligatory requirement insertion should have fixed the
    * action enabler. */
   fc_assert(action_enabler_obligatory_reqs_missing(enabler) == NULL);


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

Reply via email to