summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-28 18:26:21 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-28 18:26:21 +0000
commit034bede36c8836beaa5089926cd9c3172a3c1ec2 (patch)
tree65522d4769b47c2883b3733df6edaffac64806d9 /src
parent2fbedc46150f0b296d165ff58defd3a5e6a7deb9 (diff)
downloadhercules-034bede36c8836beaa5089926cd9c3172a3c1ec2.tar.gz
hercules-034bede36c8836beaa5089926cd9c3172a3c1ec2.tar.bz2
hercules-034bede36c8836beaa5089926cd9c3172a3c1ec2.tar.xz
hercules-034bede36c8836beaa5089926cd9c3172a3c1ec2.zip
- Added trade-range check on trade reply.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7377 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/trade.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/map/trade.c b/src/map/trade.c
index 26f2c03b0..407560697 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -86,7 +86,18 @@ void trade_tradeack(struct map_session_data *sd, int type) {
sd->trade_partner=0;
return;
}
-
+
+ //Copied here as well since the original character could had warped.
+ if (type == 3 && pc_isGM(target_sd) < lowest_gm_level && (sd->bl.m != target_sd->bl.m ||
+ (sd->bl.x - target_sd->bl.x <= -5 || sd->bl.x - target_sd->bl.x >= 5) ||
+ (sd->bl.y - target_sd->bl.y <= -5 || sd->bl.y - target_sd->bl.y >= 5)))
+ {
+ sd->trade_partner=0;
+ target_sd->trade_partner = 0;
+ clif_tradestart(sd, 0); // too far
+ return;
+ }
+
clif_tradestart(target_sd, type);
clif_tradestart(sd, type);
if (type == 4) { // Cancel