- Fixed a typo in map_search_freecell which was returning incorrect cells according to the ranges given. Increased the max number of iteration for finding a suitable cell to 100.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6172 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex
2006-04-19 00:28:42 +00:00
parent 411991788d
commit a2ba8edd25
2 changed files with 4 additions and 2 deletions

View File

@@ -1402,13 +1402,13 @@ int map_search_freecell(struct block_list *src, int m, short *x,short *y, int rx
}
if (rx >= 0 && ry >= 0) {
tries = rx2*ry2;
if (tries > 50) tries = 50;
if (tries > 100) tries = 100;
} else
tries = 100;
while(tries--) {
*x = (rx >= 0)?(rand()%rx2-rx+bx):(rand()%(map[m].xs-2)+1);
*y = (ry >= 0)?(rand()%rx2-ry+by):(rand()%(map[m].ys-2)+1);
*y = (ry >= 0)?(rand()%ry2-ry+by):(rand()%(map[m].ys-2)+1);
if (map_getcell(m,*x,*y,CELL_CHKREACH))
{