Author: sveinung
Date: Sat Oct  8 20:57:50 2016
New Revision: 34065

URL: http://svn.gna.org/viewcvs/freeciv?rev=34065&view=rev
Log:
Allow removing an enabler from a ruleset.

Rulesets can now change while in memory. Improve action enabler support of
this by introducing the function action_enabler_remove().

See patch #7787

Modified:
    branches/S2_6/common/actions.c
    branches/S2_6/common/actions.h

Modified: branches/S2_6/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.c?rev=34065&r1=34064&r2=34065&view=diff
==============================================================================
--- branches/S2_6/common/actions.c      (original)
+++ branches/S2_6/common/actions.c      Sat Oct  8 20:57:50 2016
@@ -476,6 +476,18 @@
 }
 
 /**************************************************************************
+  Remove an action enabler from the current ruleset.
+
+  Returns TRUE on success.
+**************************************************************************/
+bool action_enabler_remove(struct action_enabler *enabler)
+{
+  return action_enabler_list_remove(
+        action_enablers_for_action(enabler->action),
+        enabler);
+}
+
+/**************************************************************************
   Get all enablers for an action.
 **************************************************************************/
 struct action_enabler_list *

Modified: branches/S2_6/common/actions.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.h?rev=34065&r1=34064&r2=34065&view=diff
==============================================================================
--- branches/S2_6/common/actions.h      (original)
+++ branches/S2_6/common/actions.h      Sat Oct  8 20:57:50 2016
@@ -172,6 +172,7 @@
 
 struct action_enabler *action_enabler_new(void);
 void action_enabler_add(struct action_enabler *enabler);
+bool action_enabler_remove(struct action_enabler *enabler);
 
 bool is_action_enabled_unit_on_city(const enum gen_action wanted_action,
                                     const struct unit *actor_unit,


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

Reply via email to