From 034bede36c8836beaa5089926cd9c3172a3c1ec2 Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 28 Jun 2006 18:26:21 +0000 Subject: - Added trade-range check on trade reply. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7377 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 1 + src/map/trade.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-70-g09d2