mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 09:39:11 +00:00
fix(Core/Loot): Set skinnable flag only after all loot was taken. Source: TrinityCore. (#9573)
Fixes #9318
This commit is contained in:
@@ -17116,9 +17116,16 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
||||
if (!creature->IsPet() && creature->GetLootMode() > 0)
|
||||
{
|
||||
creature->DeleteThreatList();
|
||||
CreatureTemplate const* cInfo = creature->GetCreatureTemplate();
|
||||
if (cInfo && (cInfo->lootid || cInfo->maxgold > 0))
|
||||
|
||||
// must be after setDeathState which resets dynamic flags
|
||||
if (!creature->loot.empty())
|
||||
{
|
||||
creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
creature->AllLootRemovedFromCorpse();
|
||||
}
|
||||
}
|
||||
|
||||
// Call KilledUnit for creatures, this needs to be called after the lootable flag is set
|
||||
|
||||
Reference in New Issue
Block a user