From bde640d49c4a26203d76ea5884c1264b3f7828e2 Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 15 Mar 2006 21:07:00 +0000 Subject: - Added mapflag nodrop, fixed mapflag notrade. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5619 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pc.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index a467f3607..559f18677 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2502,35 +2502,37 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount) nullpo_retr(1, sd); if(n < 0 || n >= MAX_INVENTORY) - return 1; + return 0; if(amount <= 0) - return 1; + return 0; if (sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount < amount || sd->trade_partner != 0 || sd->vender_id != 0 || sd->status.inventory[n].amount <= 0) - return 1; + return 0; + + if (map[sd->bl.m].flag.nodrop) { + clif_displaymessage (sd->fd, msg_txt(271)); + return 0; //Can't drop items in nodrop mapflag maps. + } - if (!pc_candrop(sd,sd->status.inventory[n].nameid)) - { //The client does not likes being silently ignored, so we send it a del of 0 qty - clif_delitem(sd,n,0); + if (!pc_candrop(sd,sd->status.inventory[n].nameid)) { clif_displaymessage (sd->fd, msg_txt(263)); - return 1; + return 0; } - + //Logs items, dropped by (P)layers [Lupus] if(log_config.pick > 0 ) log_pick(sd, "P", 0, sd->status.inventory[n].nameid, -amount, (struct item*)&sd->status.inventory[n]); //Logs - if (map_addflooritem(&sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, NULL, NULL, NULL, 2) != 0) - pc_delitem(sd, n, amount, 0); - else - clif_delitem(sd,n,0); - - return 0; + if (!map_addflooritem(&sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, NULL, NULL, NULL, 2)) + return 0; + + pc_delitem(sd, n, amount, 0); + return 1; } /*========================================== -- cgit v1.2.3-70-g09d2