summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/map/map.c b/src/map/map.c
index af3f48ad0..02d3bbdeb 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -996,6 +996,8 @@ int map_foreachincell(int (*func)(struct block_list*,va_list),int m,int x,int y,
va_list ap;
int blockcount=bl_list_count,i,c;
+ if (x < 0 || y < 0 || x >= map[m].xs || y >= map[m].ys) return 0;
+
va_start(ap,type);
by=y/BLOCK_SIZE;