[Freeciv-Dev] Re: Server Error (PR#666)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> 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
|
|