diff options
author | No Name <remoit(DOT)nane(AT)gmail(DOT)com> | 2010-02-19 19:41:40 -0800 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-02-21 21:18:55 -0700 |
commit | d6c7054a1818434b4880eb9365593b5018429aa2 (patch) | |
tree | cdcc6451327e4160c957b58ecbbba5d62659bb9f | |
parent | 1eb4fdd275a56c5b001628c722dbde7b78e4ece0 (diff) | |
download | tmwa-d6c7054a1818434b4880eb9365593b5018429aa2.tar.gz tmwa-d6c7054a1818434b4880eb9365593b5018429aa2.tar.bz2 tmwa-d6c7054a1818434b4880eb9365593b5018429aa2.tar.xz tmwa-d6c7054a1818434b4880eb9365593b5018429aa2.zip |
Cancel active trade if an item is removed from inventory.
Modifies the previous fix to now cancel if an item is deleted from a
player's inventory, including items that are used/consumed.
-rw-r--r-- | src/map/pc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 20db3fe..8d1066d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3383,9 +3383,6 @@ int pc_remove_items (struct map_session_data *player, int item_id, int count) nullpo_retr (0, player); - if (player->trade_partner != 0) - trade_tradecancel (player); - for (i = 0; i < MAX_INVENTORY && count; i++) { if (player->status.inventory[i].nameid == item_id) @@ -3476,6 +3473,9 @@ int pc_delitem (struct map_session_data *sd, int n, int amount, int type) { nullpo_retr (1, sd); + if (sd->trade_partner != 0) + trade_tradecancel (sd); + if (sd->status.inventory[n].nameid == 0 || amount <= 0 || sd->status.inventory[n].amount < amount || sd->inventory_data[n] == NULL) |