Core/Loot: Skinning improvements
* Set skinnable flag only after all loot was taken * Creatures are skinnable only once - after skinning, the player only has to loot the creature again if he did not take all skinning loot
This commit is contained in:
@@ -15271,11 +15271,8 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
|
||||
if (creature)
|
||||
{
|
||||
Loot* loot = &creature->loot;
|
||||
if (creature->lootForPickPocketed)
|
||||
{
|
||||
if (creature->loot.loot_type == LOOT_PICKPOCKETING)
|
||||
creature->ResetPickPocketRefillTimer();
|
||||
creature->lootForPickPocketed = false;
|
||||
}
|
||||
|
||||
loot->clear();
|
||||
if (uint32 lootid = creature->GetCreatureTemplate()->lootid)
|
||||
@@ -15394,9 +15391,12 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
|
||||
if (!creature->IsPet())
|
||||
{
|
||||
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