[Hotfix] Delete later in RemoveItem second case

This commit is contained in:
Akkadius 2025-01-25 14:04:57 -06:00
parent faa8a492f7
commit 119151c0e3

View File

@ -695,9 +695,11 @@ void NPC::RemoveItem(uint32 item_id, uint16 quantity, uint16 slot)
else if (item->item_id == item_id && item->equip_slot == slot && quantity >= 1) {
if (item->charges <= quantity) {
m_loot_items.erase(cur);
safe_delete(item);
UpdateEquipmentLight();
if (UpdateActiveLight()) { SendAppearancePacket(AppearanceType::Light, GetActiveLightType()); }
if (UpdateActiveLight()) {
SendAppearancePacket(AppearanceType::Light, GetActiveLightType());
}
safe_delete(item);
}
else {
item->charges -= quantity;