From 3fbd2b3b3b8277ded2b8139139e62e32c3db3145 Mon Sep 17 00:00:00 2001 From: Emistry Date: Sun, 5 Jul 2015 06:56:51 +0800 Subject: Fixed issue #560 @sold[] return named item values. --- src/map/npc.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/map/npc.c b/src/map/npc.c index 8114cacaa..a79062c77 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2057,19 +2057,18 @@ int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short* item_li script->setarray_pc(sd, "@sold_nameid", i, (void*)(intptr_t)sd->status.inventory[idx].nameid, &key_nameid); script->setarray_pc(sd, "@sold_quantity", i, (void*)(intptr_t)item_list[i*2+1], &key_amount); - - if (itemdb->isequip(sd->status.inventory[idx].nameid)) { - // process equipment based information into the arrays - script->setarray_pc(sd, "@sold_refine", i, (void*)(intptr_t)sd->status.inventory[idx].refine, &key_refine); - script->setarray_pc(sd, "@sold_attribute", i, (void*)(intptr_t)sd->status.inventory[idx].attribute, &key_attribute); - script->setarray_pc(sd, "@sold_identify", i, (void*)(intptr_t)sd->status.inventory[idx].identify, &key_identify); - - for (j = 0; j < MAX_SLOTS; 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[j]); - } + + // process item based information into the arrays + script->setarray_pc(sd, "@sold_refine", i, (void*)(intptr_t)sd->status.inventory[idx].refine, &key_refine); + script->setarray_pc(sd, "@sold_attribute", i, (void*)(intptr_t)sd->status.inventory[idx].attribute, &key_attribute); + script->setarray_pc(sd, "@sold_identify", i, (void*)(intptr_t)sd->status.inventory[idx].identify, &key_identify); + + for (j = 0; j < MAX_SLOTS; j++) { + // store each of the cards/special info from the item 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[j]); } + } // invoke event -- cgit v1.2.3-60-g2f50