diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-15 21:07:00 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-15 21:07:00 +0000 |
commit | bde640d49c4a26203d76ea5884c1264b3f7828e2 (patch) | |
tree | 35be87ac5f58dcdb1a389da9db6fc77db1b9c4d7 /src/map/pc.c | |
parent | 29424f4862169ff53b78b233a1ef490329817f0f (diff) | |
download | hercules-bde640d49c4a26203d76ea5884c1264b3f7828e2.tar.gz hercules-bde640d49c4a26203d76ea5884c1264b3f7828e2.tar.bz2 hercules-bde640d49c4a26203d76ea5884c1264b3f7828e2.tar.xz hercules-bde640d49c4a26203d76ea5884c1264b3f7828e2.zip |
- Added mapflag nodrop, fixed mapflag notrade.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5619 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 30 |
1 files changed, 16 insertions, 14 deletions
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;
}
/*==========================================
|