Author: cazfi
Date: Sat Aug 15 19:57:01 2015
New Revision: 29524

URL: http://svn.gna.org/viewcvs/freeciv?rev=29524&view=rev
Log:
Sanity check improvement genus against its other properties.

See patch #6206

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=29524&r1=29523&r2=29524&view=diff
==============================================================================
--- branches/S2_6/server/rssanity.c     (original)
+++ branches/S2_6/server/rssanity.c     Sat Aug 15 19:57:01 2015
@@ -442,6 +442,24 @@
   return TRUE;
 }
 
+/**************************************************************************
+  Sanity check buildings
+**************************************************************************/
+static bool rs_buildings(void)
+{
+  /* Special Genus */
+  improvement_iterate(pimprove) {
+    if (improvement_has_flag(pimprove, IF_GOLD)
+        && pimprove->genus != IG_SPECIAL) {
+      ruleset_error(LOG_ERROR,
+                    "Gold producing improvement with genus other than 
\"Special\"");
+
+      return FALSE;
+    }
+  } improvement_iterate_end;
+
+  return TRUE;
+}
 
 /**************************************************************************
   Check that boolean effect types have sensible effects.
@@ -868,6 +886,9 @@
   if (ok) {
     ok = rs_barbarian_units();
   }
+  if (ok) {
+    ok = rs_buildings();
+  }
 
   return ok;
 }


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

Reply via email to