[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]
I have implemented your suggestion with the genlist.
This is the first attachment.
There are a few extra lines of map display code between
#ifdef DEBUG.. #endif
which might be useful for testing the patch.
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'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.
This is the second attachment.
>Peter Schaefer <schaefer@xxxxxx> wrote:
>
>> The bug is triggered by the apollo program, which tells the client about
>> every city, which in turn becomes am entire continent by itself.
>>
>> I have worked around it by assigning all these cities the same number.
>
>This seems to me a special-case fix to a general-case problem.
>
>How about the following instead:
>
>- Change the continent field to a short or int. (Server can still
>just use up to 255 real continents if it wants).
>- Instead of an array to keep track of used contient numbers in
>the client, keep track of the maximum continent number, and
>have a genlist for any re-used numbers. When a new number
>is required, take it from the genlist, or if empty, increment
>the maximum.
>
|
|