diff options
-rw-r--r-- | src/map/pc.c | 6 | ||||
-rw-r--r-- | src/map/trade.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 4e702c0..f5458e4 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2908,6 +2908,12 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount) { nullpo_retr(1, sd); + if(n < 0 || n >= MAX_INVENTORY) + return 0; + + if(amount <= 0) + return 0; + if (sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount < amount || sd->trade_partner != 0 || sd->vender_id != 0 || diff --git a/src/map/trade.c b/src/map/trade.c index da43d67..8bf2cb2 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -27,6 +27,12 @@ void trade_traderequest(struct map_session_data *sd,int target_id) return; } } + if (target_sd->npc_id) + { + //Trade fails if you are using an NPC. + clif_tradestart(sd, 2); + return; + } if((target_sd->trade_partner !=0) || (sd->trade_partner !=0)) { trade_tradecancel(sd); //person is in another trade } |