summaryrefslogtreecommitdiff
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
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
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/map/trade.c13
2 files changed, 13 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 0b4f96c90..0f5a54151 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/05/28
+ * Added trade-range check on trade start. [Skotlex]
* Added inf2 4096 (INF2_ALLOW_ENEMY) which is to be used in conjunction
with INF2_PARTY_ONLY/INF2_GUILD_ONLY when said skill should ALSO be allowed
to be used on enemies. [Skotlex]
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