summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-16 14:54:37 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-16 14:54:37 +0000
commit2a323347a11c9d39add66024ff88c1a2a5ee985d (patch)
tree742aa7d721f3cef5e1350d0a1d509a1170600d8e /src/map/map.c
parented800c53cea74042b2666c9588f8e92787013d14 (diff)
downloadhercules-2a323347a11c9d39add66024ff88c1a2a5ee985d.tar.gz
hercules-2a323347a11c9d39add66024ff88c1a2a5ee985d.tar.bz2
hercules-2a323347a11c9d39add66024ff88c1a2a5ee985d.tar.xz
hercules-2a323347a11c9d39add66024ff88c1a2a5ee985d.zip
- Added a check to map_searchfreecell to handle the case when no ranges are specified (returns the center tile).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6622 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 9e962a5d5..dc79b1750 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1474,6 +1474,13 @@ int map_search_freecell(struct block_list *src, int m, short *x,short *y, int rx
by = src->y;
m = src->m;
}
+ if (!rx && !ry) {
+ //No range? Return the target cell then....
+ *x = bx;
+ *y = by;
+ return map_getcell(m,*x,*y,CELL_CHKREACH);
+ }
+
if (rx >= 0 && ry >= 0) {
tries = rx2*ry2;
if (tries > 100) tries = 100;