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:
Shauren
2014-06-26 22:01:55 +02:00
parent 224b5c08df
commit 74850abcfc
8 changed files with 51 additions and 74 deletions
+6 -6
View File
@@ -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