Skip item stacking logic if items not found in XDT

This commit is contained in:
Gent 2021-03-04 11:22:01 -05:00
parent 5fdef50f0f
commit 29dbe83a0b

View File

@ -130,7 +130,8 @@ void ItemManager::itemMoveHandler(CNSocket* sock, CNPacketData* data) {
// swap/stack items in session // swap/stack items in session
Item* itemDat = getItemData(toItem->iID, toItem->iType); Item* itemDat = getItemData(toItem->iID, toItem->iType);
if (itemDat->stackSize > 1 && itemDat == getItemData(fromItem->iID, fromItem->iType) && fromItem->iOpt < itemDat->stackSize && toItem->iOpt < itemDat->stackSize) { Item* itemDatFrom = getItemData(fromItem->iID, fromItem->iType);
if (itemDat != nullptr && itemDatFrom != nullptr && itemDat->stackSize > 1 && itemDat == itemDatFrom && fromItem->iOpt < itemDat->stackSize && toItem->iOpt < itemDat->stackSize) {
// items are stackable, identical, and not maxed, so run stacking logic // items are stackable, identical, and not maxed, so run stacking logic
toItem->iOpt += fromItem->iOpt; // sum counts toItem->iOpt += fromItem->iOpt; // sum counts