<URL: http://bugs.freeciv.org/Ticket/Display.html?id=35145 >

The Eiffel fix is right on target. The obsoletion check should be made
with respect to the considering player, not target. The fear check
should, I think, not be relative to considering player's gold, but take
into account the number of cities that the target can buy units in. If
he has lots of gold and few cities, he may not be able to rush buy a
large enough army in time.

New patch attached.

  -Per
Index: ai/advdiplomacy.c
===================================================================
--- ai/advdiplomacy.c	(revision 12601)
+++ ai/advdiplomacy.c	(working copy)
@@ -669,6 +669,9 @@
 
     built_impr_iterate(pcity, id) {
       want += impr_build_shield_cost(id);
+      if (improvement_obsolete(pplayer, id)) {
+        continue;
+      }
       if (is_great_wonder(id)) {
         want += impr_build_shield_cost(id) * 2;
       } else if (is_small_wonder(id)) {
@@ -712,6 +715,10 @@
   distance = player_distance_to_player(pplayer, target);
   ai->diplomacy.player_intel[target->player_no].distance = distance;
 
+  /* Worry a bit if the other player has extreme amounts of wealth
+   * that can be used in cities to quickly buy an army. */
+  fear += (target->economic.gold / 5000) * city_list_size(target->cities);
+
   /* Tech lead is worrisome. FIXME: Only consider 'military' techs. */
   fear += MAX(get_player_research(target)->techs_researched
               - get_player_research(pplayer)->techs_researched, 0) * 100;
@@ -912,8 +919,10 @@
 
     /* Increase the love if aplayer has got a building that makes 
      * us love him more. Typically it's Eiffel Tower */
-    pplayer->ai.love[aplayer->player_no] +=
-      get_player_bonus(aplayer, EFT_GAIN_AI_LOVE) * MAX_AI_LOVE / 1000;
+    if (!NEVER_MET(pplayer, aplayer)) {
+      pplayer->ai.love[aplayer->player_no] +=
+        get_player_bonus(aplayer, EFT_GAIN_AI_LOVE) * MAX_AI_LOVE / 1000;
+    }
   } players_iterate_end;
 
   /* Can we win by space race? */
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to