diff options
author | momacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-05 05:25:16 +0000 |
---|---|---|
committer | momacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-05 05:25:16 +0000 |
commit | 784aae93bcd8d0ed59f5351921e103e7545e5ea6 (patch) | |
tree | 52d0abf56bd71d3738cac0b06914ad9f9d163eb8 /src/map/atcommand.c | |
parent | 012bd2da191b99c55d7a4be9cb3685cfd56c3919 (diff) | |
download | hercules-784aae93bcd8d0ed59f5351921e103e7545e5ea6.tar.gz hercules-784aae93bcd8d0ed59f5351921e103e7545e5ea6.tar.bz2 hercules-784aae93bcd8d0ed59f5351921e103e7545e5ea6.tar.xz hercules-784aae93bcd8d0ed59f5351921e103e7545e5ea6.zip |
- Re-committed r16971/trunk/src/ (tid:74924).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16994 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 394f4fb11..30e9fb753 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6148,8 +6148,9 @@ ACMD_FUNC(mobsearch) /*========================================== * @cleanmap - cleans items on the ground + * @cleanarea - cleans items on the ground within an specified area *------------------------------------------*/ -static int atcommand_cleanmap_sub(struct block_list *bl, va_list ap) +static int atcommand_cleanfloor_sub(struct block_list *bl, va_list ap) { nullpo_ret(bl); map_clearflooritem(bl); @@ -6159,10 +6160,25 @@ static int atcommand_cleanmap_sub(struct block_list *bl, va_list ap) ACMD_FUNC(cleanmap) { - map_foreachinarea(atcommand_cleanmap_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); + map_foreachinmap(atcommand_cleanfloor_sub, sd->bl.m, BL_ITEM); + clif_displaymessage(fd, msg_txt(1221)); // All dropped items have been cleaned up. + return 0; +} + +ACMD_FUNC(cleanarea) +{ + int x0 = 0, y0 = 0, x1 = 0, y1 = 0; + + if (!message || !*message || sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1) < 1) { + map_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); + } + else if (sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1) == 1) { + map_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); + } + else if (sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1) == 4) { + map_foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, x0, y0, x1, y1, BL_ITEM); + } + clif_displaymessage(fd, msg_txt(1221)); // All dropped items have been cleaned up. return 0; } @@ -8977,6 +8993,7 @@ void atcommand_basecommands(void) { ACMD_DEF(misceffect), ACMD_DEF(mobsearch), ACMD_DEF(cleanmap), + ACMD_DEF(cleanarea), ACMD_DEF(npctalk), ACMD_DEF(pettalk), ACMD_DEF(users), |