- 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
This commit is contained in:
brianluau 2012-11-05 07:12:44 +00:00
parent c4ba335c08
commit f9807c537b

View File

@ -1568,7 +1568,7 @@ static int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short*
int key_refine = 0; int key_refine = 0;
int key_attribute = 0; int key_attribute = 0;
int key_identify = 0; int key_identify = 0;
int key_card = 0; int key_card[MAX_SLOTS];
// discard old contents // discard old contents
script_cleararray_pc(sd, "@sold_nameid", (void*)0); 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++ ) for( j = 0; MAX_SLOTS > j; j++ )
{// clear each of the card slot entries {// clear each of the card slot entries
key_card[j] = 0;
snprintf(card_slot, sizeof(card_slot), "@sold_card%d", j + 1); snprintf(card_slot, sizeof(card_slot), "@sold_card%d", j + 1);
script_cleararray_pc(sd, card_slot, (void*)0); 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++ ) for( j = 0; MAX_SLOTS > j; j++ )
{// store each of the cards from the equipment in the array {// store each of the cards from the equipment in the array
snprintf(card_slot, sizeof(card_slot), "@sold_card%d", j + 1); 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]);
} }
} }
} }