Complete.Org: Mailing Lists: Archives: freeciv-dev: December 1999:
[Freeciv-Dev] Re: patch for "ran out of continents in client" bug
Home

[Freeciv-Dev] Re: patch for "ran out of continents in client" bug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "David Pfitzner" <dwp@xxxxxxxxxxxxxx>
Cc: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: patch for "ran out of continents in client" bug
From: "Peter Schaefer" <schaefer@xxxxxx>
Date: Tue, 28 Dec 1999 06:30:01 +0100

-----Ursprüngliche Nachricht-----
Von: David Pfitzner <dwp@xxxxxxxxxxxxxx>
An: schaefer@xxxxxx <schaefer@xxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx <freeciv-dev@xxxxxxxxxxx>
Datum: Montag, 27. Dezember 1999 14:32
Betreff: Re: [Freeciv-Dev] Re: patch for "ran out of continents in client"
bug


>Peter Schaefer wrote:
>
>> I have implemented your suggestion with the genlist.
>
>Ok.  Actually, I since thought that maybe an athing (see
>common/astring.c) may be more convenient, but never mind :-)
>
>In climisc.c,
>  #define NCONT 256
>can disappear, right?


It should match the size of short, the continent number.

>As should the "ran out of continent numbers in client" check/message?
>
>> The patch treats the arctic and antarctic as special cases, but it
>> is switched off again for szenario maps (generator == 0), as entire
>> europe becomes the arctic for that map of europe.
>
>I think the arctic and antarctic need not be special cases
>in the client.  Indeed in general the client may not know if
>a given square is connected to the arctic/antarctic, as in
>the example you give.  (Or there could be multiple disconnected
>arctic/antarctic continents, although not sure if the _server_
>handles this correctly.  Ie in a scenario.)  Actually, does the
>client even know the correct value of generator?  I suspect not.
>
The code that does this does not break the other continents when it is off
or not.

>> I've changed about 3 lines in map.h and map.c, and one line in climisc.c
>> such that a short value is used instead of an unsigned char. Fortunately,
>> all of the code I spotted that uses the continent value is reading it
into
>> an int, so everything should work ok.
>
>Yep, thats what I hoped.  Any reason for an explicitly signed short?
>(I would have thought just short, or unsigned short if being explicit.)

I thought you would ask. The way it is before, the function get_continent
does use a char, which is different from the unsigned char of the continent
value.
I wanted to point out by making it signed short that it is not by accident
signed :-)


>
>-- David
>


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