Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2006:
[Freeciv-Dev] (PR#15611) SDL client: don't show diplomacy when attached
Home

[Freeciv-Dev] (PR#15611) SDL client: don't show diplomacy when attached

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: himasaram@xxxxxxxx
Subject: [Freeciv-Dev] (PR#15611) SDL client: don't show diplomacy when attached to AI player
From: "Christian Prochaska" <cp.ml.freeciv.dev@xxxxxxxxxxxxxx>
Date: Fri, 3 Mar 2006 14:52:14 -0800
Reply-to: bugs@xxxxxxxxxxx

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

> [dmarks - Sa 18. Feb 2006, 12:51:49]:
> 
> When attached to an AI player (possibly true with a human player as
> well) you are often shown the diplomacy meeting dialog where you may
> even accept or decline offers for the AI. It is also possible to call
> upon meetings yourself through the ui and make your own offers.
> 
> -Daniel
> 

Patch attached.
Index: client/gui-sdl/diplodlg.c
===================================================================
--- client/gui-sdl/diplodlg.c   (Revision 11701)
+++ client/gui-sdl/diplodlg.c   (Arbeitskopie)
@@ -115,6 +115,10 @@
                                    bool other_accepted)
 {
   struct diplomacy_dialog *pdialog = get_diplomacy_dialog(counterpart);
+
+  if (!pdialog) {
+    return;
+  }
   
   pdialog->treaty.accept0 = I_accepted;
   pdialog->treaty.accept1 = other_accepted;
@@ -1116,6 +1120,14 @@
 {
   struct diplomacy_dialog *pdialog;
 
+  if (!can_client_issue_orders()) {
+    return;
+  }
+
+  if (game.player_ptr->ai.control) {
+    return;                    /* Don't show if we are AI controlled. */
+  }
+
   if (!(pdialog = get_diplomacy_dialog(counterpart))) {
     pdialog = create_diplomacy_dialog(game.player_ptr,
                                get_player(counterpart));

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#15611) SDL client: don't show diplomacy when attached to AI player, Christian Prochaska <=