diff --git a/src/map/script.cpp b/src/map/script.cpp index b9ad0f7c7d..090e22eb17 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -11288,7 +11288,7 @@ BUILDIN_FUNC(getunits) int type = script_getnum(st, 2); int size = 0; int32 idx, id; - int16 m = 0, x0 = 0, y0 = 0, x1 = 0, y1 = 0; + int16 m = -1, x0 = 0, y0 = 0, x1 = 0, y1 = 0; struct s_mapiterator *iter = mapit_alloc(MAPIT_NORMAL, bl_type(type)); if (!strcmp(command, "getmapunits")) @@ -11347,7 +11347,7 @@ BUILDIN_FUNC(getunits) for (bl = (struct block_list*)mapit_first(iter); mapit_exists(iter); bl = (struct block_list*)mapit_next(iter)) { - if (!m || (m == bl->m && !x0 && !y0 && !x1 && !y1) || (bl->m == m && (bl->x >= x0 && bl->y >= y0) && (bl->x <= x1 && bl->y <= y1))) + if (m == -1 || (m == bl->m && !x0 && !y0 && !x1 && !y1) || (bl->m == m && (bl->x >= x0 && bl->y >= y0) && (bl->x <= x1 && bl->y <= y1))) { if (data) set_reg(st, sd, reference_uid(id, idx + size), name, (is_string_variable(name) ? (void*)status_get_name(bl) : (void*)__64BPRTSIZE(bl->id)), reference_getref(data));