Skip to content

Commit

Permalink
fix: onDeEquip properly handled at logout/death (opentibiabr#2625)
Browse files Browse the repository at this point in the history
  • Loading branch information
luanluciano93 authored May 24, 2024
1 parent 1df6ce5 commit 5f88c6d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,13 @@ void Player::onRemoveCreature(std::shared_ptr<Creature> 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<Slots_t>(slot));
}
}

if (isLogout) {
if (m_party) {
m_party->leaveParty(player);
Expand Down

0 comments on commit 5f88c6d

Please sign in to comment.