Skip to content

Commit

Permalink
fix: onDeEquip properly handled at logout/death (#2625)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luan Luciano 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

2 comments on commit 5f88c6d

@lamonato29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the player dies and logs in again, imbuements are not applied. This means you have to unequip and re-equip items. I recommend dropping this part of the code inside -> if (isLogout)...

@luanluciano93
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the player dies and logs in again, imbuements are not applied. This means you have to unequip and re-equip items. I recommend dropping this part of the code inside -> if (isLogout)...

7753b8c

Please sign in to comment.