Author: sveinung
Date: Fri Oct 21 12:35:52 2016
New Revision: 34199

URL: http://svn.gna.org/viewcvs/freeciv?rev=34199&view=rev
Log:
A real embassy excludes no embassy at all.

Let the DiplRel requirements contradiction checking know that the presence
of a real embassy contradicts the absence of any embassy at all.

See patch #7855

Modified:
    trunk/common/player.c

Modified: trunk/common/player.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/player.c?rev=34199&r1=34198&r2=34199&view=diff
==============================================================================
--- trunk/common/player.c       (original)
+++ trunk/common/player.c       Fri Oct 21 12:35:52 2016
@@ -1469,7 +1469,7 @@
 
 /* The number of mutually exclusive requirement sets that
  * diplrel_mess_gen() creates for the DiplRel requirement type. */
-#define DIPLREL_MESS_SIZE (1 + (DRO_LAST * (5 + 4 + 3 + 2 + 1)))
+#define DIPLREL_MESS_SIZE (3 + (DRO_LAST * (5 + 4 + 3 + 2 + 1)))
 
 /**************************************************************************
   Generate and return an array of mutually exclusive requirement sets for
@@ -1527,6 +1527,30 @@
 
   mess_pos++;
 
+  /* Having a real embassy excludes not having an embassy. */
+  BV_CLR_ALL(mess[mess_pos]);
+
+  BV_SET(mess[mess_pos],
+         requirement_diplrel_ereq(DRO_HAS_REAL_EMBASSY, REQ_RANGE_LOCAL,
+                                  TRUE));
+  BV_SET(mess[mess_pos],
+         requirement_diplrel_ereq(DRO_HAS_EMBASSY, REQ_RANGE_LOCAL,
+                                  FALSE));
+
+  mess_pos++;
+
+  /* Hosting a real embassy excludes not hosting an embassy. */
+  BV_CLR_ALL(mess[mess_pos]);
+
+  BV_SET(mess[mess_pos],
+         requirement_diplrel_ereq(DRO_HOSTS_REAL_EMBASSY, REQ_RANGE_LOCAL,
+                                  TRUE));
+  BV_SET(mess[mess_pos],
+         requirement_diplrel_ereq(DRO_HOSTS_EMBASSY, REQ_RANGE_LOCAL,
+                                  FALSE));
+
+  mess_pos++;
+
   /* Loop over diplstate_type and diplrel_other. */
   for (rel = 0; rel < DRO_LAST; rel++) {
     /* The presence of a DiplRel at a more local range proves that it can't


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

Reply via email to