From 86f70d9f4ff1715dccbc101b78728c366623fe7b Mon Sep 17 00:00:00 2001 From: Piotr HaƂaczkiewicz Date: Wed, 17 Jul 2013 21:13:21 +0200 Subject: Refactored map_foreach* functions. Removed a lot of duplicated code. Added some documentation & comments. --- src/map/atcommand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 29bd43d16..a0a6623cf 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6152,10 +6152,10 @@ ACMD(cleanarea) int x0 = 0, y0 = 0, x1 = 0, y1 = 0; if (!message || !*message || sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1) < 1) { - iMap->foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, sd->bl.x - (AREA_SIZE * 2), sd->bl.y - (AREA_SIZE * 2), sd->bl.x + (AREA_SIZE * 2), sd->bl.y + (AREA_SIZE * 2), BL_ITEM); + iMap->foreachinrange(atcommand_cleanfloor_sub, &sd->bl, AREA_SIZE * 2, BL_ITEM); } else if (sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1) == 1) { - iMap->foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, sd->bl.x - x0, sd->bl.y - x0, sd->bl.x + x0, sd->bl.y + x0, BL_ITEM); + iMap->foreachinrange(atcommand_cleanfloor_sub, &sd->bl, x0, BL_ITEM); } else if (sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1) == 4) { iMap->foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, x0, y0, x1, y1, BL_ITEM); -- cgit v1.2.3-60-g2f50