diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-02-19 18:47:45 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-02-19 18:47:45 +0000 |
commit | 17f0f15706cebb77c4ffe236ae1ace6233c3800f (patch) | |
tree | 3751354823e1e9c72ac80ff9dac96354b17094ee /src/map | |
parent | 41a81ad3cb89f25ebb5af3cd7cb67f25081b7bf0 (diff) | |
download | hercules-17f0f15706cebb77c4ffe236ae1ace6233c3800f.tar.gz hercules-17f0f15706cebb77c4ffe236ae1ace6233c3800f.tar.bz2 hercules-17f0f15706cebb77c4ffe236ae1ace6233c3800f.tar.xz hercules-17f0f15706cebb77c4ffe236ae1ace6233c3800f.zip |
* Fixed buying stores could be opened and sold to regardless of distance between seller and buyer (since r14713).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14715 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/buyingstore.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c index 21629e641..6871797c8 100644 --- a/src/map/buyingstore.c +++ b/src/map/buyingstore.c @@ -195,6 +195,11 @@ void buyingstore_open(struct map_session_data* sd, int account_id) return; } + if( sd->bl.m != pl_sd->bl.m || !check_distance_bl(&sd->bl, &pl_sd->bl, AREA_SIZE) ) + {// out of view range + return; + } + // success clif_buyingstore_itemlist(sd, pl_sd); } @@ -231,6 +236,12 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int return; } + if( sd->bl.m != pl_sd->bl.m || !check_distance_bl(&sd->bl, &pl_sd->bl, AREA_SIZE) ) + {// out of view range + clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0); + return; + } + if( pl_sd->status.zeny < pl_sd->buyingstore.zenylimit ) {// buyer lost zeny in the mean time? fix the limit pl_sd->buyingstore.zenylimit = pl_sd->status.zeny; |