فهرست منبع

* Fixed buying stores could be opened and sold to regardless of distance between seller and buyer (since r14713).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14715 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 سال پیش
والد
کامیت
3f4cacac0b
2فایلهای تغییر یافته به همراه12 افزوده شده و 0 حذف شده
  1. 1 0
      Changelog-Trunk.txt
  2. 11 0
      src/map/buyingstore.c

+ 1 - 0
Changelog-Trunk.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 2011/02/19
+	* Fixed buying stores could be opened and sold to regardless of distance between seller and buyer (since r14713). [Ai4rei]
 	* Fixed 'feature.conf' not getting loaded and a typo buying store feature setting name (follow up to r14713). [Ai4rei]
 	* Implemented buying store system (aka. reverse vending, purchase shop) together with related skill and items, without NPCs. [Ai4rei]
 	- For SQL apply upgrade_svn14713_log.sql to upgrade tables `picklog` and `zenylog`; for TXT no action is necessary.

+ 11 - 0
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;