Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2005:
[Freeciv-Dev] (PR#13393)
Home

[Freeciv-Dev] (PR#13393)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13393)
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Sat, 2 Jul 2005 03:21:10 -0700
Reply-to: bugs@xxxxxxxxxxx

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

The dialog in which you can select a tech which a spy can steal doesn't
work if you don't have an embassy with the victim player.

This patch fixes the problem in S2_0.

I'm working on spy stealing cleanup in HEAD. Fix for this problem will
be available when I finish the cleanup. I just don't want to mess my
patches.
--
mateusz
Index: client/gui-gtk-2.0/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/dialogs.c,v
retrieving revision 1.75.2.8
diff -u -r1.75.2.8 dialogs.c
--- client/gui-gtk-2.0/dialogs.c        8 Dec 2004 20:48:35 -0000       1.75.2.8
+++ client/gui-gtk-2.0/dialogs.c        2 Jul 2005 10:18:49 -0000
@@ -424,7 +424,7 @@
                                 struct player *pvictim)
 {  
   GtkWidget *sw, *label, *vbox, *view;
-  int i, j;
+  int i;
   GtkListStore *store;
   GtkCellRenderer *rend;
   GtkTreeViewColumn *col;
@@ -481,8 +481,6 @@
   gtk_container_add(GTK_CONTAINER(vbox), sw);
 
   /* Now populate the list */
-  j = 0;
-
   if (pvictim) { /* you don't want to know what lag can do -- Syela */
     GtkTreeIter it;
     GValue value = { 0, };
@@ -499,19 +497,16 @@
        gtk_list_store_set_value(store, &it, 0, &value);
        g_value_unset(&value);
        gtk_list_store_set(store, &it, 1, i, -1);
-        j++;
       }
     }
 
-    if(j > 0) {
-      gtk_list_store_append(store, &it);
+    gtk_list_store_append(store, &it);
 
-      g_value_init(&value, G_TYPE_STRING);
-      g_value_set_static_string(&value, _("At Spy's Discretion"));
-      gtk_list_store_set_value(store, &it, 0, &value);
-      g_value_unset(&value);
-      gtk_list_store_set(store, &it, 1, game.num_tech_types, -1);
-    }
+    g_value_init(&value, G_TYPE_STRING);
+    g_value_set_static_string(&value, _("At Spy's Discretion"));
+    gtk_list_store_set_value(store, &it, 0, &value);
+    g_value_unset(&value);
+    gtk_list_store_set(store, &it, 1, game.num_tech_types, -1);
   }
 
   gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_tech_shell),

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13393), Mateusz Stefek <=