fix(Core/Loot): Proeprly handle UNIT_DYNFLAG_LOOTABLE flag. (#9761)

Fixes #9741
This commit is contained in:
UltraNix
2021-12-24 10:04:43 +01:00
committed by GitHub
parent 6a88b48f98
commit d0f8cf3dd4
2 changed files with 2 additions and 2 deletions

View File

@@ -17171,7 +17171,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
creature->DeleteThreatList();
// must be after setDeathState which resets dynamic flags
if (!creature->loot.empty())
if (!creature->loot.isLooted())
{
creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}

View File

@@ -363,7 +363,7 @@ struct Loot
loot_type = LOOT_NONE;
}
[[nodiscard]] bool empty() const { return items.empty() && quest_items.empty() && gold == 0; }
[[nodiscard]] bool empty() const { return items.empty() && gold == 0; }
[[nodiscard]] bool isLooted() const { return gold == 0 && unlootedCount == 0; }
void NotifyItemRemoved(uint8 lootIndex);