diff --git a/src/items/item.cpp b/src/items/item.cpp index dd2d5c965a6..2ad0cfa4abd 100644 --- a/src/items/item.cpp +++ b/src/items/item.cpp @@ -3160,16 +3160,17 @@ void Item::addUniqueId(uint16_t uniqueId) { } bool Item::canDecay() { - if (isRemoved() || isDecayDisabled()) { + const ItemType &it = Item::items[id]; + if (it.decayTo < 0 || it.decayTime == 0 || isDecayDisabled()) { return false; } - const ItemType &it = Item::items[id]; - if (it.decayTo < 0 || it.decayTime == 0) { + if (hasAttribute(ItemAttribute_t::UNIQUEID)) { return false; } - if (hasAttribute(ItemAttribute_t::UNIQUEID)) { + // In certain conditions, such as depth nested containers, this can overload the CPU, so it is left last. + if (isRemoved()) { return false; }