Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] Re: (PR#8754) effects patch
Home

[Freeciv-Dev] Re: (PR#8754) effects patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8754) effects patch
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Wed, 21 Jul 2004 18:50:36 -0700
Reply-to: rt@xxxxxxxxxxx

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

On Wed, 21 Jul 2004, Jason Short wrote:

> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8754 >
>
> This piece of code:
>
> -  if (city_got_building(pcity, B_COURTHOUSE)) {
> -    dist /= 4;
> -  }
> +  dist -= (dist * get_city_bonus(pcity, EFT_INCITE_DIST_PCT)) / 100;
>
> is logically correct but will, I think, cause savegames to differ
> because the rounding is different.  This may make debugging harder.  It
> would be possible to have

Savegames will differ for other reasons as well. The AI building
selection code in the domestic advisor is completely different for
example.

>    dist = dist * (100 - get_city_bonus(...)) / 100
>
> instead; it's up to you.

Either way is fine by me. Are you certain this rounds in the same way as
/4?

I used the previous method because it is used elsewhere in the code. For
e.g. in the city science calcs.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa






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