Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] Re: (PR#10336) citymap cleanup
Home

[Freeciv-Dev] Re: (PR#10336) citymap cleanup

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#10336) citymap cleanup
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 25 Sep 2004 16:53:34 -0700
Reply-to: rt@xxxxxxxxxxx

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

Per I. Mathisen wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=10336 >
> 
> On Sat, 25 Sep 2004, Jason Short wrote:
> 
>>- Another major bug is fixed: the citymap is never initialized. It
>>starts out as 0 but if you play multiple games it gets filled with
>>garbage. This is a severe bug and will probably never show up in any
>>tests.
> 
> ...
> 
>>(Side note: is this really the way it's supposed to be?Shouldn't the
>>citymap be resetat some point during the game?Shouldn't there be one
>>citymap per player?Etc., etc.)
> 
> What are you talking about? citymap_turn_init() remakes the citymap every
> turn.

Ahh yes.  However I forgot to change that call...it will need a new patch.

>>  -          citymap[x1][y1] = citymap[x1][y1]++;
>>  +          CITYMAP(x1, y1)++;
>>
>>the former is clearly not what was intended since it does nothing (I
>>think).  I assume the latter is what was meant.
> 
> 
> If this was broken, I can't see how it would work at all. Do you get
> autogame differences? If this was a bug and you fixed it, AI would behave
> quite differently when choosing cities.

Savegames are identical in the one autogame I ran.

I can't see where this value is ever checked.  Nobody seems to care if 
the value is greater than 0.  But I have no idea what this value is 
supposed to mean (there is *no* documentation for citymap that I can 
see) so really I have no idea what is going on.

It's also possible that the two lines of code give the same results.  Is 
the ++ evaluated after the = or before it?  I have no idea.

jason




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