summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Friis <peavey@placid.dk>2008-04-03 18:06:59 +0000
committerDennis Friis <peavey@placid.dk>2008-04-03 18:06:59 +0000
commit1421906b5eb50519bc5db36e06536c3e451a2794 (patch)
tree0c8376a17a9798d42bf67eb0a03d63e9a1badd16
parentc525c9c76dfeb45f0653dc3dc7642727f3b97a91 (diff)
downloadtmwa-1421906b5eb50519bc5db36e06536c3e451a2794.tar.gz
tmwa-1421906b5eb50519bc5db36e06536c3e451a2794.tar.bz2
tmwa-1421906b5eb50519bc5db36e06536c3e451a2794.tar.xz
tmwa-1421906b5eb50519bc5db36e06536c3e451a2794.zip
Fix auto map picking exploit by checking proximity of player and item.
-rw-r--r--src/map/clif.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 1f320b2..f847a56 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7796,6 +7796,9 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd) {
if (fitem == NULL || fitem->bl.m != sd->bl.m)
return;
+ if (abs(sd->bl.x - fitem->bl.x) >= 2 || abs(sd->bl.y - fitem->bl.y) >= 2)
+ return; // too far away to pick up
+
pc_takeitem(sd, fitem);
}