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

Use this patch. Probably more clean and keep old behaviours.
diff -urNa freeciv-2.0.orig/client/gui-gtk-2.0/cityrep.c freeciv-2.0/client/gui-gtk-2.0/cityrep.c
--- freeciv-2.0.orig/client/gui-gtk-2.0/cityrep.c	2007-09-26 14:19:42.000000000 +0200
+++ freeciv-2.0/client/gui-gtk-2.0/cityrep.c	2007-09-26 11:27:21.000000000 +0200
@@ -52,7 +52,7 @@
 #include "cityrep.h"
 
 #define NEG_VAL(x)  ((x)<0 ? (x) : (-x))
-#define CMA_NONE	(cmafec_preset_num())
+#define CMA_NONE	(-1)
 #define CMA_CUSTOM	(-2)
 
 enum city_operation_type {
@@ -548,19 +548,13 @@
   gtk_menu_item_set_submenu(parent_item, menu);
 
   if (change_cma) {
-    for (i = 0; i <= cmafec_preset_num(); i++) {
-      if ( i == CMA_NONE) {
-	w = gtk_menu_item_new_with_label(_("none"));
-	gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), w);	
-      } else {
-	w = gtk_menu_item_new_with_label(cmafec_preset_get_descr(i));
-	gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
-      }
+    for (i = -1; i < cmafec_preset_num(); i++) {
+      w = (i == -1 ? gtk_menu_item_new_with_label(_("none"))
+	   : gtk_menu_item_new_with_label(cmafec_preset_get_descr(i)));
+      gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
       g_signal_connect(w, "activate", G_CALLBACK(select_cma_callback),
 		       GINT_TO_POINTER(i));
-
     }
-    
   } else {
     /* search for a "none" */
     int found;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to