Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] Re: (PR#7236) removal of most direct references to build_c
Home

[Freeciv-Dev] Re: (PR#7236) removal of most direct references to build_c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: use_less@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7236) removal of most direct references to build_cost
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Mon, 2 Feb 2004 01:16:18 -0800
Reply-to: rt@xxxxxxxxxxx

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

On Sun, Feb 01, 2004 at 09:59:44PM -0800, James Canete wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7236 >
> 
> Savegames weren't matching up, so I reverted to an old version of the
> patch, without the *_incite_gold_cost() functions, since they were more
> or less horribly named, and redirected the calls in city_incite_cost()
> to *_buy_gold_cost() functions.

Nice work. There are some issues:

 - am I correct that 
       notify_player_ex(pplayer, pcity->x, pcity->y, E_IMP_SOLD,
                       _("Game: %s is selling %s (not needed) for %d."), 
                       pcity->name, get_improvement_name(i), 
-                      improvement_value(i)/2);
+                      impr_sell_gold(i));

   removes a bug in the original code?

 - the *_buy_gold_cost. I think you got side-tracked here with the
 factor of 2. I have restored some of the users you added for these to
 use the *_build_shield_cost one and apply the factor of 2 by
 themself. The reason here is that these users doesn't want to know
 the real buy cost but some estimate.

 For the user which wants the exact numbers (city_buy_cost) I have
 added a new parameter to the *_buy_gold_cost functions. So eventually
 the estimation callers _could_ be converted.

 - in unit_upgrade_price() I have replaced 

const int diff = unit_build_shield_cost(to) - unit_build_shield_cost(from) / 2;

   with

const int diff = unit_build_shield_cost(to) - unit_disband_shields(from);

   I think this is more exact. Later I have converted it to a call of
   unit_buy_gold_cost()

Autogames are the same for clean, your patch and my patch.

So when you agree to my changes I will apply it.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  (On the statement print "42 monkeys"+"1 snake"): BTW, both perl and Python
  get this wrong. Perl gives 43 and Python gives "42 monkeys1 snake", when 
  the answer is clearly "41 monkeys and 1 fat snake".  
    -- Jim Fulton, 10 Aug 1999

Attachment: build_cost-ref-removal12.diff.gz
Description: application/gunzip


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