Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2001:
[Freeciv-Dev] Re: Server Error (PR#666)
Home

[Freeciv-Dev] Re: Server Error (PR#666)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Server Error (PR#666)
From: 蔡恆華 <iquin@xxxxxxxxxx>
Date: Sun, 28 Jan 2001 20:26:01 -0500 (EST)

> I am quite sure I found the real error. [snip]
Well, I was just guessing, you're correct.

> Why not just
> yo = myrand(map.ysize);
> xo = myrand(map.xsize);
+---------------+-------+ 0              Your island size is as
|               |       |                large as region D. If
|       A       |   B   |                you pick a random spot
+---------------+-------+ map.ysize+n-s  in region C or D, you
|       C       |   D   |                can't place your island
+---------------+-------+ map.ysize      as it will touch the
0      map.xsize+w-e  map.xsize          south pole. While region
                                         B causes x wraparound.
>> What I can recall is placeisland() was not meant to place islands
>> across x=0.
> Why not?
The effect is barely noticable and this is a CPU intensive part.
Also, I suspect rewriting for(x=w;x<e;x++)do_something(x+xo-w);
to x=e-w;do do_something(x+xo-1);while(--x); helps in optimization.

Regards,
I.Q.
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup



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