Author: mir3x
Date: Thu Nov 24 07:52:43 2016
New Revision: 34627

URL: http://svn.gna.org/viewcvs/freeciv?rev=34627&view=rev
Log:
Qt client - governor sliders could be incorrect if there was custom governor

See bug #25335

Modified:
    trunk/client/gui-qt/citydlg.cpp

Modified: trunk/client/gui-qt/citydlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/citydlg.cpp?rev=34627&r1=34626&r2=34627&view=diff
==============================================================================
--- trunk/client/gui-qt/citydlg.cpp     (original)
+++ trunk/client/gui-qt/citydlg.cpp     Thu Nov 24 07:52:43 2016
@@ -55,6 +55,7 @@
 #include "hudwidget.h"
 
 //agents
+#include "cma_core.h"
 #include "cma_fec.h"
 
 extern QApplication *qapp;
@@ -2171,16 +2172,15 @@
 ****************************************************************************/
 void city_dialog::update_sliders()
 {
-  const struct cm_parameter *param;
+  struct cm_parameter *param;
   int output;
   QVariant qvar;
   QLabel *label;
 
-  if (cma_table->currentRow() == -1 || cmafec_preset_num() == 0) {
+  param = new cm_parameter;
+  if (cma_is_city_under_agent(pcity, param) == false) {
     return;
   }
-
-  param = cmafec_preset_get_parameter(cma_table->currentRow());
 
   for (output = O_FOOD; output < 2 * O_LAST; output++) {
     slider_tab[output]->blockSignals(true);
@@ -2210,6 +2210,7 @@
   for (output = O_FOOD; output < 2 * O_LAST; output++) {
     slider_tab[output]->blockSignals(false);
   }
+  delete param;
 }
 
 /****************************************************************************


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

Reply via email to