diff options
author | Haru <haru@dotalux.com> | 2020-02-09 23:07:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-09 23:07:31 +0100 |
commit | 66b624165ba2e7c868b38081230a61691be447df (patch) | |
tree | 77b4c11f6500772c2e8b7106d3d1533d0fe07f42 /src/map/map.c | |
parent | c4ab59ff86fc12d1e7643bbe55a2149c8dc0e56a (diff) | |
parent | f2f6fdec4be88cc1fcb82d7882f3a2fcf0cad7bf (diff) | |
download | hercules-66b624165ba2e7c868b38081230a61691be447df.tar.gz hercules-66b624165ba2e7c868b38081230a61691be447df.tar.bz2 hercules-66b624165ba2e7c868b38081230a61691be447df.tar.xz hercules-66b624165ba2e7c868b38081230a61691be447df.zip |
Merge pull request #2619 from dastgirp/getunits/fix
Crash fixes
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 8b52fc761..33f3fe716 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); |