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

When meeting for the first time, the AI gives you two, different messages 
to offer you a cease-fire. This patch fixes the issue.

   - Per
Index: ai/advdiplomacy.c
===================================================================
--- ai/advdiplomacy.c   (revision 13566)
+++ ai/advdiplomacy.c   (working copy)
@@ -459,24 +459,6 @@
     }
     break;
 
-  case CLAUSE_EMBASSY:
-    if (give) {
-      if (ds_after == DS_ALLIANCE) {
-        worth = 0;
-      } else if (ds_after == DS_PEACE) {
-        worth = -5 * game.info.turn;
-      } else {
-        worth = MIN(-50 * game.info.turn
-                    + pplayer->ai.love[player_index(aplayer)], 
-                    -5 * game.info.turn);
-      }
-    } else {
-      worth = 0; /* We don't need no stinkin' embassy, do we? */
-    }
-    DIPLO_LOG(LOG_DIPL, pplayer, aplayer, "embassy clause worth %d",
-              worth);
-    break;
-
   case CLAUSE_LAST:
     break;
   } /* end of switch */
@@ -804,10 +786,14 @@
                                 struct player *aplayer)
 {
   if (pplayer->ai.control && !ai_handicap(pplayer, H_AWAY)) {
+    struct ai_data *ai = ai_data_get(pplayer);
+    struct ai_dip_intel *adip = 
&ai->diplomacy.player_intel[player_index(aplayer)];
+
     notify(aplayer, _("*%s (AI)* Greetings %s! May we suggest a ceasefire "
            "while we get to know each other better?"),
            pplayer->name, aplayer->name);
     ai_diplomacy_suggest(pplayer, aplayer, CLAUSE_CEASEFIRE, 0);
+    adip->asked_about_ceasefire = 6; /* anti-spam measure */
   }
 }
 
@@ -1052,13 +1038,6 @@
     ai_diplomacy_suggest(aplayer, pplayer, CLAUSE_VISION, 0);
   }
 
-  if (!player_has_embassy(pplayer, aplayer)) {
-    ai_diplomacy_suggest(aplayer, pplayer, CLAUSE_EMBASSY, 0);
-  }
-  if (!player_has_embassy(aplayer, pplayer)) {
-    ai_diplomacy_suggest(pplayer, aplayer, CLAUSE_EMBASSY, 0);
-  }
-  
   if (!ai_handicap(pplayer, H_DIPLOMACY) || !aplayer->ai.control) {
     suggest_tech_exchange(pplayer, aplayer);
   }
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to