[Freeciv-Dev] Re: civserver segfault with new research system (PR#1221)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, Jan 14, 2002 at 05:27:11AM -0800, Gregory Berkolaiko wrote:
> --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > And here is the patch. Please test since I added another assert since
>
> Oy-voy-voy! Just look what happens if tech_leakage = 2 and you have an
> embassy with one player who happens to possess some technologies. The
> cost for all these technologies will be 0!!!
>
> > case 2:
> > {
> > int players = 0, players_with_tech = 0;
> >
> > /* Find out how many players have tech */
> > players_iterate(other) {
> > if (!player_has_embassy(pplayer, other)) {
> > continue;
> > }
> >
> > players++;
> > if (get_invention(other, tech) == TECH_KNOWN) {
> > players_with_tech++;
> > }
> > } players_iterate_end;
> >
> > if (players > 0) {
> > /* The player has an embassy with at least one other player */
> > cost = ((players - players_with_tech) * cost) / players;
> > }
> > }
> > break;
>
> Well, actually not 0 but 1, but it's the same thing.
> You probably want to initialise players to 1
> (and then remove if(players > 0) condition).
>
> But even so, leakage mode number 2 makes little sense.
I agree with you. However the idea for all isn't from me. We have the
following choices:
- keep it, fix it and wait for the original authors answer
- disable it
- remove it
> Much more sensible IMO is to have
>
> int players = get_num_human_and_ai_players();
> cost *= (players - players_with_tech_and_embassy) / players;
>
> That is the only difference from mode 1 is that only those with whom we
> have embassy count towards players_with_tech.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"I heard if you play the NT-4.0-CD backwards, you get a satanic message."
"That's nothing, if you play it forward, it installs NT-4.0"
[Freeciv-Dev] Re: civserver segfault with new research system (PR#1221), Justin Moore, 2002/01/16
[Freeciv-Dev] Re: civserver segfault with new research system (PR#1221), Raimar Falke, 2002/01/16
[Freeciv-Dev] Re: civserver segfault with new research system (PR#1221), Christian Knoke, 2002/01/17
|
|