Core/Creature: Despawn skinned creatures.

Fixes issue 4047.

--HG--
branch : trunk
This commit is contained in:
linencloth
2010-09-17 15:16:26 +02:00
parent 7708e2ea06
commit 8622446ab9
@@ -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;
}
}