diff options
author | smokexyz <sagunkho@hotmail.com> | 2017-07-04 20:01:56 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-04 20:01:56 +0530 |
commit | a4c9508bcc252b8601821a042e522d232ea19857 (patch) | |
tree | cf36d2b465724e703369e3167c96da5295eb8f0f /src/map | |
parent | bb5064f4f8e63364ddc8cb7523ebc3a7def905ed (diff) | |
parent | 8ad26d759d290ddc714ed66a80f012adffe9a485 (diff) | |
download | hercules-a4c9508bcc252b8601821a042e522d232ea19857.tar.gz hercules-a4c9508bcc252b8601821a042e522d232ea19857.tar.bz2 hercules-a4c9508bcc252b8601821a042e522d232ea19857.tar.xz hercules-a4c9508bcc252b8601821a042e522d232ea19857.zip |
Merge pull request #1782 from dastgir/bug/sellitem
Fixes crash with sell shop.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/npc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 2876ea595..a358fd2fb 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2119,6 +2119,17 @@ int npc_selllist_sub(struct map_session_data *sd, struct itemlist *item_list, st script->cleararray_pc(sd, card_slot, (void*)0); } + for (j = 0; j < MAX_ITEM_OPTIONS; j++) { // Clear Each item option entry + key_opt_idx[j] = 0; + key_opt_value[j] = 0; + + snprintf(opt_index_str, sizeof(opt_index_str), "@slot_opt_idx%d", j + 1); + script->cleararray_pc(sd, opt_index_str, (void*)0); + + snprintf(opt_value_str, sizeof(opt_value_str), "@slot_opt_val%d", j + 1); + script->cleararray_pc(sd, opt_value_str, (void*)0); + } + // save list of to be sold items for (i = 0; i < VECTOR_LENGTH(*item_list); i++) { struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i); |