Sfoglia il codice sorgente

- Added a check when buying from npcs to allow buying of item_avail items.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7883 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 anni fa
parent
commit
13489e30a8
2 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 2 0
      Changelog-Trunk.txt
  2. 2 1
      src/map/npc.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ 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/07/25
+	* Added a check when buying from npcs to allow buying of item_avail items.
+	  [Skotlex]
 	* Fixed duel accept invite sending the packet before the duel data is set
 	  (resulting in a packet that noone receives). Thanks to Toms for finding it
 	  out. [Skotlex]

+ 2 - 1
src/map/npc.c

@@ -1197,7 +1197,8 @@ int npc_buylist(struct map_session_data *sd,int n,unsigned short *item_list)
 
 	for(i=0,w=0,z=0;i<n;i++) {
 		for(j=0;nd->u.shop_item[j].nameid;j++) {
-			if (nd->u.shop_item[j].nameid==item_list[i*2+1])
+			if (nd->u.shop_item[j].nameid==item_list[i*2+1] || //Normal items
+				itemdb_viewid(nd->u.shop_item[j].nameid)==item_list[i*2+1]) //item_avail replacement
 				break;
 		}
 		if (nd->u.shop_item[j].nameid==0)