diff options
Diffstat (limited to 'src/map/map.c')
-rw-r--r-- | src/map/map.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/map.c b/src/map/map.c index afdc2ed41..8639a2a8b 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -638,9 +638,12 @@ static int map_foreachinmap(int (*func)(struct block_list*, va_list), int16 m, i static int map_forcountinmap(int (*func)(struct block_list*, va_list), int16 m, int count, int type, ...) { - int returnCount; + int returnCount = 0; va_list ap; + if (m < 0) + return returnCount; + va_start(ap, type); returnCount = map->vforcountinarea(func, m, 0, 0, map->list[m].xs, map->list[m].ys, count, type, ap); va_end(ap); |