From 8f636b001acb84dd41edaa0e7926f98b70716b92 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Tue, 2 Apr 2024 11:13:08 -0300 Subject: [PATCH] fix: transform item logic error --- src/game/game.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 9310f1c9a20..cac0b596ebf 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -2616,12 +2616,10 @@ std::shared_ptr Game::transformItem(std::shared_ptr item, uint16_t n auto decaying = item->getDecaying(); // If the item is decaying, we need to transform it to the new item - if (decaying > DECAYING_FALSE && item->getDuration() <= 1) { + if (decaying > DECAYING_FALSE && item->getDuration() <= 1 && newType.decayTo) { g_logger().debug("Decay duration old type {}, transformEquipTo {}, transformDeEquipTo {}", curType.decayTo, curType.transformEquipTo, curType.transformDeEquipTo); - g_logger().debug("Decay duration new type, decayTo {}, transformEquipTo {}, transformDeEquipTo {}", newType.decayTo, newType.transformEquipTo, newType.transformDeEquipTo); - if (newType.decayTo) { - itemId = newType.decayTo; - } + g_logger().debug("Decay duration new type decayTo {}, transformEquipTo {}, transformDeEquipTo {}", newType.decayTo, newType.transformEquipTo, newType.transformDeEquipTo); + itemId = newType.decayTo; } else if (curType.id != newType.id) { if (newType.group != curType.group) { item->setDefaultSubtype();