Author: cazfi
Date: Wed Jun 29 12:24:22 2016
New Revision: 33107

URL: http://svn.gna.org/viewcvs/freeciv?rev=33107&view=rev
Log:
Correceted the way sdl-clients calculate production change penalty.

See bug #24807

Modified:
    trunk/client/gui-sdl2/wldlg.c

Modified: trunk/client/gui-sdl2/wldlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/wldlg.c?rev=33107&r1=33106&r2=33107&view=diff
==============================================================================
--- trunk/client/gui-sdl2/wldlg.c       (original)
+++ trunk/client/gui-sdl2/wldlg.c       Wed Jun 29 12:24:22 2016
@@ -300,35 +300,33 @@
   This is needed by calculation of change production shields penalty.
   [similar to are_universals_equal()]
 **************************************************************************/
-static bool are_the_same_class(const struct universal *one,
-                               const struct universal *two)
+static bool are_prods_same_class(const struct universal *one,
+                                 const struct universal *two)
 {
   if (one->kind != two->kind) {
     return FALSE;
   }
-  if (VUT_UTYPE == one->kind) {
-    return one->value.utype == two->value.utype;
-  }
+
   if (VUT_IMPROVEMENT == one->kind) {
     if (is_wonder(one->value.building)) {
       return is_wonder(two->value.building);
-    }
-
-    return (one->value.building == two->value.building);
+    } else {
+      return !is_wonder(two->value.building);
+    }
   }
 
   return FALSE;
 }
 
 /**************************************************************************
-  Change production in editor shell, callculate production shields penalty and
+  Change production in editor shell, calculate production shields penalty and
   refresh production progress label
 **************************************************************************/
 static void change_production(struct universal *prod)
 {
-  if (!are_the_same_class(&pEditor->currently_building, prod)) {
+  if (!are_prods_same_class(&pEditor->currently_building, prod)) {
     if (pEditor->stock != pEditor->pCity->shield_stock) {
-      if (are_the_same_class(&pEditor->pCity->production, prod)) {
+      if (are_prods_same_class(&pEditor->pCity->production, prod)) {
         pEditor->stock = pEditor->pCity->shield_stock;
       }
     } else {


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

Reply via email to