Author: sveinung
Date: Sun Jul 19 13:01:01 2015
New Revision: 29223

URL: http://svn.gna.org/viewcvs/freeciv?rev=29223&view=rev
Log:
Sanity check: a unit capable of bombardment has a bombard_rate

See patch #6128

Modified:
    branches/S2_6/server/rssanity.c

Modified: branches/S2_6/server/rssanity.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/rssanity.c?rev=29223&r1=29222&r2=29223&view=diff
==============================================================================
--- branches/S2_6/server/rssanity.c     (original)
+++ branches/S2_6/server/rssanity.c     Sun Jul 19 13:01:01 2015
@@ -627,7 +627,8 @@
     }
   } unit_type_iterate_end;
 
-  /* Some unit type flags depend on other flags to work properly. */
+  /* Some unit type properties depend on other unit type properties 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
@@ -637,6 +638,16 @@
       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;
+    }
+
+    /* The ability to bombard requires a bombard_rate. */
+    if (utype_has_flag(putype, UTYF_BOMBARDER)
+        && putype->bombard_rate <= 0) {
+      ruleset_error(LOG_ERROR,
+                    "The unit type '%s' has the 'Bombarder' unit type flag"
+                    " but no bombard_rate is set.",
                     utype_rule_name(putype));
       ok = FALSE;
     }


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

Reply via email to