Jelajahi Sumber

- Fixed OnSellItem not setting all the "@sold_card%d" arrays. (bugreport:6847)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16860 54d463be-8e91-2dee-dedb-b68131a5f0ec
brianluau 12 tahun lalu
induk
melakukan
f9807c537b
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      src/map/npc.c

+ 3 - 2
src/map/npc.c

@@ -1568,7 +1568,7 @@ static int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short*
 	int key_refine = 0;
 	int key_attribute = 0;
 	int key_identify = 0;
-	int key_card = 0;
+	int key_card[MAX_SLOTS];
 
 	// discard old contents
 	script_cleararray_pc(sd, "@sold_nameid", (void*)0);
@@ -1579,6 +1579,7 @@ static int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short*
 
 	for( j = 0; MAX_SLOTS > j; j++ )
 	{// clear each of the card slot entries
+		key_card[j] = 0;
 		snprintf(card_slot, sizeof(card_slot), "@sold_card%d", j + 1);
 		script_cleararray_pc(sd, card_slot, (void*)0);
 	}
@@ -1600,7 +1601,7 @@ static int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short*
 			for( j = 0; MAX_SLOTS > j; j++ )
 			{// store each of the cards from the equipment in the array
 				snprintf(card_slot, sizeof(card_slot), "@sold_card%d", j + 1);
-				script_setarray_pc(sd, card_slot, i, (void*)(intptr_t)sd->status.inventory[idx].card[j], &key_card);
+				script_setarray_pc(sd, card_slot, i, (void*)(intptr_t)sd->status.inventory[idx].card[j], &key_card[j]);
 			}
 		}
 	}