[Bug Fix] Fix issue with NPCs no longer using some armor. (#3318)

* [BugFix/NPCs] Fix issue with NPCs no longer using some armor.

* Removed redundant memory clear
This commit is contained in:
Paul Coene
2023-04-24 17:05:29 -04:00
committed by GitHub
parent 8b1d64a043
commit e19b8d3056
2 changed files with 11 additions and 13 deletions
+6 -2
View File
@@ -361,11 +361,12 @@ void NPC::AddLootDrop(
SetArrowEquipped(true);
}
bool found = false; // track if we found an empty slot we fit into
if (loot_drop.equip_item > 0) {
uint8 eslot = 0xFF;
char newid[20];
const EQ::ItemData* compitem = nullptr;
bool found = false; // track if we found an empty slot we fit into
int32 foundslot = -1; // for multi-slot items
// Equip rules are as follows:
@@ -500,7 +501,6 @@ void NPC::AddLootDrop(
}
if (found) {
CalcBonuses(); // This is less than ideal for bulk adding of items
item->equip_slot = foundslot;
}
}
@@ -510,6 +510,10 @@ void NPC::AddLootDrop(
}
else safe_delete(item);
if (found) {
CalcBonuses();
}
if (IsRecordLootStats()) {
m_rolled_items.emplace_back(item->item_id);
}