From 5f88c6d635018debc3fbc6168782d504aeec19cb Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Fri, 24 May 2024 08:58:51 -0300 Subject: [PATCH] fix: onDeEquip properly handled at logout/death (#2625) --- src/creatures/players/player.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 553ca2e3b04..4109eb77472 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -1862,6 +1862,13 @@ void Player::onRemoveCreature(std::shared_ptr creature, bool isLogout) Creature::onRemoveCreature(creature, isLogout); if (auto player = getPlayer(); player == creature) { + for (uint8_t slot = CONST_SLOT_FIRST; slot <= CONST_SLOT_LAST; ++slot) { + const auto item = inventory[slot]; + if (item) { + g_moveEvents().onPlayerDeEquip(getPlayer(), item, static_cast(slot)); + } + } + if (isLogout) { if (m_party) { m_party->leaveParty(player);