From bbb417dab074fa33058b9ced4c818e20cf465a79 Mon Sep 17 00:00:00 2001 From: aleos Date: Fri, 3 Jun 2022 15:03:21 -0400 Subject: [PATCH] Fixes an item comparison check when loading chars * Fixes #4933. * Adds a missing card slot check when validating items during character loading. * Also adds the random options to the check. Thanks to @lukasrmattos! --- src/char/char.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/char/char.cpp b/src/char/char.cpp index 82b27799ad..b67a899140 100644 --- a/src/char/char.cpp +++ b/src/char/char.cpp @@ -629,9 +629,8 @@ int char_memitemdata_to_sql(const struct item items[], int max, int id, enum sto continue; if( items[i].nameid == item.nameid - && items[i].card[0] == item.card[0] - && items[i].card[2] == item.card[2] - && items[i].card[3] == item.card[3] + && (memcmp(items[i].card, item.card, sizeof(int) * MAX_SLOTS) == 0) + && (memcmp(items[i].option, item.option, 5 * MAX_ITEM_RDM_OPT) == 0) && items[i].unique_id == item.unique_id ) { //They are the same item. int k;