Author: sveinung
Date: Tue Mar  8 15:08:57 2016
New Revision: 32198

URL: http://svn.gna.org/viewcvs/freeciv?rev=32198&view=rev
Log:
Requirement reasoning: a building has a genus.

The BuildingGenus requirement type has been added in Freeciv 3.0. A building
universal can fulfill it.

See bug #24505

Modified:
    trunk/common/requirements.c

Modified: trunk/common/requirements.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/requirements.c?rev=32198&r1=32197&r2=32198&view=diff
==============================================================================
--- trunk/common/requirements.c (original)
+++ trunk/common/requirements.c Tue Mar  8 15:08:57 2016
@@ -3620,9 +3620,19 @@
    * cannot fulfill the requirements. This is necessary to allow
    * requirement vectors to specify multiple required improvements. */
 
-  if (preq->source.kind == VUT_IMPROVEMENT
-      && source->value.building == preq->source.value.building) {
-    return ITF_YES;
+  switch (preq->source.kind) {
+  case VUT_IMPROVEMENT:
+    if (source->value.building == preq->source.value.building) {
+      return ITF_YES;
+    }
+    break;
+  case VUT_IMPR_GENUS:
+    if (source->value.building->genus == preq->source.value.impr_genus) {
+      return ITF_YES;
+    }
+    break;
+  default:
+    break;
   }
 
   return ITF_NOT_APPLICABLE;


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

Reply via email to