Skip to content

Commit 3f21b14

Browse files
committed
Core/Config: Fixed Rate.Corpse.Decay.Looted
Looted creatures should now correctly obey the Rate.Corpse.Decay.Looted value. Closes #5358
1 parent b3ddccb commit 3f21b14

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/server/game/Entities/Creature/Creature.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,19 +2274,16 @@ void Creature::AllLootRemovedFromCorpse()
22742274
if (m_corpseRemoveTime <= now)
22752275
return;
22762276

2277-
float decayRate;
2277+
float decayRate = sWorld->getRate(RATE_CORPSE_DECAY_LOOTED);
22782278
CreatureTemplate const* cinfo = GetCreatureTemplate();
22792279

2280-
decayRate = sWorld->getRate(RATE_CORPSE_DECAY_LOOTED);
2281-
uint32 diff = uint32((m_corpseRemoveTime - now) * decayRate);
2282-
2283-
m_respawnTime -= diff;
2284-
22852280
// corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update
22862281
if (cinfo && cinfo->SkinLootId)
22872282
m_corpseRemoveTime = time(NULL);
22882283
else
2289-
m_corpseRemoveTime -= diff;
2284+
m_corpseRemoveTime = now + m_corpseDelay * decayRate;
2285+
2286+
m_respawnTime = m_corpseRemoveTime + m_respawnTime;
22902287
}
22912288
}
22922289

0 commit comments

Comments
 (0)