summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorDennis Friis <peavey@inspircd.org>2009-07-19 15:26:09 +0200
committerDennis Friis <peavey@inspircd.org>2009-07-19 15:34:58 +0200
commit987d06fb3a6eafe1ade14269874b37170570cde9 (patch)
treed7f8d04e6b518b215a324eebafaa9de764c2fb80 /src/map
parent84783931d0944049590dd8359770657ad971be25 (diff)
downloadtmwa-987d06fb3a6eafe1ade14269874b37170570cde9.tar.gz
tmwa-987d06fb3a6eafe1ade14269874b37170570cde9.tar.bz2
tmwa-987d06fb3a6eafe1ade14269874b37170570cde9.tar.xz
tmwa-987d06fb3a6eafe1ade14269874b37170570cde9.zip
Add some sanity checks.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 2e75294..570ceb6 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2951,12 +2951,15 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
int i;
nullpo_retr(1, sd);
+ if (sd->trade_partner != 0 || sd->npc_id != 0 || sd->state.storage_flag)
+ return 0; // no dropping while trading/npc/storage
+
if(n < 0 || n >= MAX_INVENTORY)
return 0;
if(amount <= 0)
return 0;
-
+
for (i = 0; i < 11; i++) {
if (equip_pos[i] > 0 && sd->equip_index[i] == n) { //Slot taken, remove item from there.
pc_unequipitem(sd, sd->equip_index[i], 1);