summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorPiotr HaƂaczkiewicz <piotr.halaczkiewicz@gmail.com>2013-07-17 21:13:21 +0200
committerPiotr HaƂaczkiewicz <piotr.halaczkiewicz@gmail.com>2013-07-23 16:44:24 +0200
commit86f70d9f4ff1715dccbc101b78728c366623fe7b (patch)
tree8072f2fdbf9d9ae2a3dc815d2d7ce1c45fbc162d /src/map/atcommand.c
parent056c181e1c163b7d49c87bc07bf82ef11fdbd539 (diff)
downloadhercules-86f70d9f4ff1715dccbc101b78728c366623fe7b.tar.gz
hercules-86f70d9f4ff1715dccbc101b78728c366623fe7b.tar.bz2
hercules-86f70d9f4ff1715dccbc101b78728c366623fe7b.tar.xz
hercules-86f70d9f4ff1715dccbc101b78728c366623fe7b.zip
Refactored map_foreach* functions.
Removed a lot of duplicated code. Added some documentation & comments.
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c4
1 files changed, 2 insertions, 2 deletions
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);