Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] Re: (PR#10008) "net income" is wrong
Home

[Freeciv-Dev] Re: (PR#10008) "net income" is wrong

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#10008) "net income" is wrong
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Sep 2004 21:10:45 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10008 >

Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=10008 >
> 
> My "net income" (found by clicking on the panel in the gtk2 client) is 
> listed as +11 per turn.  But I find I actually get about +50 per turn.

The reason is that player_get_expected_income is awful.  This fixes it 
(I think).

jason

Index: common/player.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/player.c,v
retrieving revision 1.154
diff -u -r1.154 player.c
--- common/player.c     15 Sep 2004 09:31:56 -0000      1.154
+++ common/player.c     16 Sep 2004 04:09:39 -0000
@@ -390,20 +390,7 @@
 
   /* City income/expenses. */
   city_list_iterate(pplayer->cities, pcity) {
-    int lux, tax, sci, trade = pcity->trade_prod;
-
-    get_tax_income(pplayer, trade, &sci, &lux, &tax);
-    income += tax;
-    income += pcity->specialists[SP_TAXMAN]
-            * game.rgame.specialists[SP_TAXMAN].bonus;
-    income += get_city_tithes_bonus(pcity);
-
-    /* Improvement upkeep. */
-    impr_type_iterate(impr_id) {
-      if (city_got_building(pcity, impr_id)) {
-       income -= improvement_upkeep(pcity, impr_id);
-      }
-    } impr_type_iterate_end;
+    income += city_gold_surplus(pcity, pcity->tax_total);
 
     /* Capitalization income. */
     if (get_current_construction_bonus(pcity, EFT_PROD_TO_GOLD) > 0) {

[Prev in Thread] Current Thread [Next in Thread]