Author: cazfi
Date: Sat Dec 19 14:15:30 2015
New Revision: 31103

URL: http://svn.gna.org/viewcvs/freeciv?rev=31103&view=rev
Log:
Replaced incorrect use of get_infrastructure_text() with 
extra_name_translated() when
building list of potential pillage targets.

Reported anonymously

See bug #23775

Modified:
    branches/S2_6/client/gui-gtk-2.0/dialogs.c
    branches/S2_6/client/gui-gtk-3.0/dialogs.c
    branches/S2_6/client/gui-qt/dialogs.cpp
    branches/S2_6/client/gui-xaw/dialogs.c
    branches/S2_6/common/unit.c

Modified: branches/S2_6/client/gui-gtk-2.0/dialogs.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-2.0/dialogs.c?rev=31103&r1=31102&r2=31103&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-2.0/dialogs.c  (original)
+++ branches/S2_6/client/gui-gtk-2.0/dialogs.c  Sat Dec 19 14:15:30 2015
@@ -354,15 +354,11 @@
 
     while ((tgt = get_preferred_pillage(extras))) {
       int what;
-      bv_extras what_extras;
-
-      BV_CLR_ALL(what_extras);
 
       what = extra_index(tgt);
       BV_CLR(extras, what);
-      BV_SET(what_extras, what);
-
-      choice_dialog_add(shl, get_infrastructure_text(what_extras),
+
+      choice_dialog_add(shl, extra_name_translation(tgt),
                         G_CALLBACK(pillage_callback),
                         GINT_TO_POINTER(what),
                         FALSE, NULL);

Modified: branches/S2_6/client/gui-gtk-3.0/dialogs.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/dialogs.c?rev=31103&r1=31102&r2=31103&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.0/dialogs.c  (original)
+++ branches/S2_6/client/gui-gtk-3.0/dialogs.c  Sat Dec 19 14:15:30 2015
@@ -355,15 +355,11 @@
 
     while ((tgt = get_preferred_pillage(extras))) {
       int what;
-      bv_extras what_extras;
-
-      BV_CLR_ALL(what_extras);
 
       what = extra_index(tgt);
       BV_CLR(extras, what);
-      BV_SET(what_extras, what);
-
-      choice_dialog_add(shl, get_infrastructure_text(what_extras),
+
+      choice_dialog_add(shl, extra_name_translation(tgt),
                         G_CALLBACK(pillage_callback),
                         GINT_TO_POINTER(what),
                         FALSE, NULL);

Modified: branches/S2_6/client/gui-qt/dialogs.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/dialogs.cpp?rev=31103&r1=31102&r2=31103&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/dialogs.cpp     (original)
+++ branches/S2_6/client/gui-qt/dialogs.cpp     Sat Dec 19 14:15:30 2015
@@ -1941,16 +1941,12 @@
   qv2 = punit->id;
   while ((tgt = get_preferred_pillage(extras))) {
     int what;
-    bv_extras what_extras;
-
-    BV_CLR_ALL(what_extras);
 
     what = extra_index(tgt);
     BV_CLR(extras, what);
-    BV_SET(what_extras, what);
 
     func = pillage_something;
-    str = get_infrastructure_text(what_extras);
+    str = extra_name_translation(tgt);
     qv1 = what;
     cd->add_item(str, func, qv1, qv2);
   }

Modified: branches/S2_6/client/gui-xaw/dialogs.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/dialogs.c?rev=31103&r1=31102&r2=31103&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/dialogs.c      (original)
+++ branches/S2_6/client/gui-xaw/dialogs.c      Sat Dec 19 14:15:30 2015
@@ -490,20 +490,16 @@
   prev = dlabel;
   while ((tgt = get_preferred_pillage(extras))) {
     int what;
-    bv_extras what_extras;
-
-    BV_CLR_ALL(what_extras);
 
     what = extra_index(tgt);
 
     BV_CLR(extras, what);
-    BV_SET(what_extras, what);
 
     button =
       XtVaCreateManagedWidget ("button", commandWidgetClass, form,
                                XtNfromVert, prev,
                                XtNlabel,
-                               
(XtArgVal)(get_infrastructure_text(what_extras)),
+                               (XtArgVal)(extra_name_translation(tgt)),
                                NULL);
     XtAddCallback(button, XtNcallback, pillage_callback,
                   INT_TO_XTPOINTER(what));

Modified: branches/S2_6/common/unit.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/unit.c?rev=31103&r1=31102&r2=31103&view=diff
==============================================================================
--- branches/S2_6/common/unit.c (original)
+++ branches/S2_6/common/unit.c Sat Dec 19 14:15:30 2015
@@ -1384,12 +1384,8 @@
     return;
   case ACTIVITY_PILLAGE:
     if (punit->activity_target != NULL) {
-      bv_extras pset;
-
-      BV_CLR_ALL(pset);
-      BV_SET(pset, extra_index(punit->activity_target));
       astr_add_line(astr, "%s: %s", get_activity_text(punit->activity),
-                    get_infrastructure_text(pset));
+                    extra_name_translation(punit->activity_target));
     } else {
       astr_add_line(astr, "%s", get_activity_text(punit->activity));
     }


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to