Author: jtn
Date: Sat Dec 19 11:10:16 2015
New Revision: 31099

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

Reported by log65536@gna.

See gna bug #23957.

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

Modified: branches/S2_5/client/citydlg_common.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/citydlg_common.c?rev=31099&r1=31098&r2=31099&view=diff
==============================================================================
--- branches/S2_5/client/citydlg_common.c       (original)
+++ branches/S2_5/client/citydlg_common.c       Sat Dec 19 11:10:16 2015
@@ -642,7 +642,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_5/common/city.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/common/city.c?rev=31099&r1=31098&r2=31099&view=diff
==============================================================================
--- branches/S2_5/common/city.c (original)
+++ branches/S2_5/common/city.c Sat Dec 19 11:10:16 2015
@@ -2843,6 +2843,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