Author: sveinung
Date: Sun May  4 14:20:51 2014
New Revision: 24846

URL: http://svn.gna.org/viewcvs/freeciv?rev=24846&view=rev
Log:
Rule set sanity check: the unit type flag "Spy" requires that "Diplomat" is set

Requested by Marko Lindqvist <cazfi>

See patch #4682

Modified:
    branches/S2_5/server/rssanity.c

Modified: branches/S2_5/server/rssanity.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/rssanity.c?rev=24846&r1=24845&r2=24846&view=diff
==============================================================================
--- branches/S2_5/server/rssanity.c     (original)
+++ branches/S2_5/server/rssanity.c     Sun May  4 14:20:51 2014
@@ -527,6 +527,21 @@
     }
   } unit_type_iterate_end;
 
+  /* Some unit type flags depend on other flags to work properly. */
+  unit_type_iterate(putype) {
+    /* "Spy" is a better "Diplomat". Until all the places that assume that
+     * "Diplomat" is set if "Spy" is set is changed this limitation must be
+     * kept. */
+    if (utype_has_flag(putype, UTYF_SPY)
+        && !utype_has_flag(putype, UTYF_DIPLOMAT)) {
+      ruleset_error(LOG_ERROR,
+                    "The unit type '%s'' has the 'Spy' unit type flag but "
+                    "not the 'Diplomat' unit type flag.",
+                    utype_rule_name(putype));
+      ok = FALSE;
+    }
+  } unit_type_iterate_end;
+
   /* Check requirement sets against conflicting requirements.
    * Effects use requirement lists */
   if (!iterate_effect_cache(effect_list_sanity_cb)) {


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

Reply via email to