Core/Creature: Despawn skinned creatures.
Fixes issue 4047. --HG-- branch : trunk
This commit is contained in:
@@ -2261,17 +2261,16 @@ void Creature::AllLootRemovedFromCorpse()
|
||||
float decayRate;
|
||||
CreatureInfo const *cinfo = GetCreatureInfo();
|
||||
|
||||
// corpse was not skinnable -> apply corpse looted timer
|
||||
if (!cinfo || !cinfo->SkinLootId)
|
||||
decayRate = sWorld.getRate(RATE_CORPSE_DECAY_LOOTED);
|
||||
// corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update
|
||||
else
|
||||
decayRate = 0.0f;
|
||||
|
||||
decayRate = sWorld.getRate(RATE_CORPSE_DECAY_LOOTED);
|
||||
uint32 diff = uint32((m_corpseRemoveTime - now) * decayRate);
|
||||
|
||||
m_corpseRemoveTime -= diff;
|
||||
m_respawnTime -= diff;
|
||||
|
||||
// corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update
|
||||
if (cinfo && cinfo->SkinLootId)
|
||||
m_corpseRemoveTime = time(NULL);
|
||||
else
|
||||
m_corpseRemoveTime -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user