Skip to content

Commit

Permalink
Fixed random options not being updated correctly
Browse files Browse the repository at this point in the history
Fixes #1527
  • Loading branch information
Lemongrass3110 committed Aug 31, 2016
1 parent f7e4001 commit 0569d85
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/char/char.c
Expand Up @@ -626,8 +626,13 @@ int char_memitemdata_to_sql(const struct item items[], int max, int id, int tabl
&& items[i].card[2] == item.card[2]
&& items[i].card[3] == item.card[3]
) { //They are the same item.
int k;

ARR_FIND( 0, MAX_SLOTS, j, items[i].card[j] != item.card[j] );
ARR_FIND( 0, MAX_ITEM_RDM_OPT, k, items[i].option[k].id != item.option[k].id || items[i].option[k].value != item.option[k].value || items[i].option[k].param != item.option[k].param );

if( j == MAX_SLOTS &&
k == MAX_ITEM_RDM_OPT &&
items[i].amount == item.amount &&
items[i].equip == item.equip &&
items[i].identify == item.identify &&
Expand Down Expand Up @@ -794,8 +799,13 @@ int char_inventory_to_sql(const struct item items[], int max, int id) {
&& items[i].card[2] == item.card[2]
&& items[i].card[3] == item.card[3]
) { //They are the same item.
int k;

ARR_FIND( 0, MAX_SLOTS, j, items[i].card[j] != item.card[j] );
ARR_FIND( 0, MAX_ITEM_RDM_OPT, k, items[i].option[k].id != item.option[k].id || items[i].option[k].value != item.option[k].value || items[i].option[k].param != item.option[k].param );

if( j == MAX_SLOTS &&
k == MAX_ITEM_RDM_OPT &&
items[i].amount == item.amount &&
items[i].equip == item.equip &&
items[i].identify == item.identify &&
Expand Down

0 comments on commit 0569d85

Please sign in to comment.