update new many items from 7.81. Also fix issue with runes charges to not stack and not throw client debug.

This commit is contained in:
ErikasKontenis
2019-11-16 00:30:27 +02:00
parent 5640c1497d
commit 6a0e161bef
6 changed files with 1553 additions and 102 deletions

View File

@@ -2131,7 +2131,7 @@ ReturnValue Player::queryAdd(int32_t index, const Thing& thing, uint32_t count,
if (ret == RETURNVALUE_NOERROR || ret == RETURNVALUE_NOTENOUGHROOM) {
//need an exchange with source?
const Item* inventoryItem = getInventoryItem(static_cast<slots_t>(index));
if (inventoryItem && (!inventoryItem->isStackable() || inventoryItem->getID() != item->getID())) {
if (inventoryItem && (!inventoryItem->isStackable() || inventoryItem->isRune() || inventoryItem->getID() != item->getID())) {
return RETURNVALUE_NEEDEXCHANGE;
}
@@ -2200,15 +2200,18 @@ ReturnValue Player::queryMaxCount(int32_t index, const Thing& thing, uint32_t co
}
if (destItem) {
if (destItem->isStackable() && item->equals(destItem) && destItem->getItemCount() < 100) {
if (!destItem->isRune() && destItem->isStackable() && item->equals(destItem) && destItem->getItemCount() < 100) {
maxQueryCount = 100 - destItem->getItemCount();
} else {
}
else {
maxQueryCount = 0;
}
} else if (queryAdd(index, *item, count, flags) == RETURNVALUE_NOERROR) { //empty slot
}
else if (queryAdd(index, *item, count, flags) == RETURNVALUE_NOERROR) { //empty slot
if (item->isStackable()) {
maxQueryCount = 100;
} else {
}
else {
maxQueryCount = 1;
}