Author: jtn
Date: Sat Dec 19 11:09:38 2015
New Revision: 31097

URL: http://svn.gna.org/viewcvs/freeciv?rev=31097&view=rev
Log:
Fix client city dialog production breakdown for cities in disorder.

Reported by log65536@gna.

See gna bug #23957.

Modified:
    branches/S2_6/client/citydlg_common.c
    branches/S2_6/common/city.c

Modified: branches/S2_6/client/citydlg_common.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/citydlg_common.c?rev=31097&r1=31096&r2=31097&view=diff
==============================================================================
--- branches/S2_6/client/citydlg_common.c       (original)
+++ branches/S2_6/client/citydlg_common.c       Sat Dec 19 11:09:38 2015
@@ -675,7 +675,11 @@
 {
   int pollu, prod, pop, mod;
 
-  pollu = city_pollution_types(pcity, pcity->prod[O_SHIELD],
+  /* On the server, pollution is calculated before production is deducted
+   * for disorder; we need to compensate for that */
+  pollu = city_pollution_types(pcity,
+                               pcity->prod[O_SHIELD]
+                               + pcity->unhappy_penalty[O_SHIELD],
                               &prod, &pop, &mod);
   buf[0] = '\0';
 

Modified: branches/S2_6/common/city.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/city.c?rev=31097&r1=31096&r2=31097&view=diff
==============================================================================
--- branches/S2_6/common/city.c (original)
+++ branches/S2_6/common/city.c Sat Dec 19 11:09:38 2015
@@ -2810,6 +2810,8 @@
 
   set_city_production(pcity);
   citizen_base_mood(pcity);
+  /* Note that pollution is calculated before unhappy_city_check() makes
+   * deductions for disorder; so a city in disorder still causes pollution */
   pcity->pollution = city_pollution(pcity, pcity->prod[O_SHIELD]);
 
   happy_copy(pcity, FEELING_LUXURY);


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

Reply via email to