(PR#10241) Make AI take part in spacerace

"Mateusz Stefek" <mstefek-IjDXvh/[email protected]>
Newsgroups gmane.games.freeciv.ai
Message-ID <[email protected]>
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10241 >

Current code is completely stupid.
This patch helps. It depends on PR#10239
With this patch AI produces Apollo only if it is a production leader.
--
mateusz
spacerace.diff (text/x-patch, 964 B)
Index: aicity.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aicity.c,v
retrieving revision 1.167
diff -u -r1.167 aicity.c
--- aicity.c	21 Sep 2004 05:51:12 -0000	1.167
+++ aicity.c	21 Sep 2004 17:06:09 -0000
@@ -318,7 +318,10 @@
 	    break;
 	  case EFT_ENABLE_SPACE:
 	    if (game.spacerace) {
-	      v += 50;
+	      v += 5;
+	      if (ai->diplomacy.production_leader == pplayer) {
+		v += 100;
+	      }
 	    }
 	    break;
 	  case EFT_GIVE_IMM_TECH:
@@ -361,7 +364,11 @@
 	  case EFT_SS_STRUCTURAL:
 	  case EFT_SS_COMPONENT:
 	  case EFT_SS_MODULE:
-	    if (game.spacerace && ai->diplomacy.strategy == WIN_SPACE) {
+	    if (game.spacerace
+	        /* If someone has started building spaceship already or
+		 * we have chance to win a spacerace */
+	        && (ai->diplomacy.spacerace_leader
+		    || ai->diplomacy.production_leader == pplayer)) {
 	      v += 95;
 	    }
 	    break;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.