mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 13:09:50 -04:00
Core/Loot: Allocate Loot separately from objects
This commit is contained in:
@@ -825,10 +825,6 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
|
||||
LastUsedScriptID = GetGOInfo()->ScriptId;
|
||||
AIM_Initialize();
|
||||
|
||||
// Initialize loot duplicate count depending on raid difficulty
|
||||
if (map->Is25ManRaid())
|
||||
loot.maxDuplicates = 3;
|
||||
|
||||
if (spawnid)
|
||||
m_spawnId = spawnid;
|
||||
|
||||
@@ -1177,12 +1173,12 @@ void GameObject::Update(uint32 diff)
|
||||
}
|
||||
break;
|
||||
case GAMEOBJECT_TYPE_CHEST:
|
||||
if (m_groupLootTimer)
|
||||
if (m_loot && m_groupLootTimer)
|
||||
{
|
||||
if (m_groupLootTimer <= diff)
|
||||
{
|
||||
if (Group* group = sGroupMgr->GetGroupByGUID(lootingGroupLowGUID))
|
||||
group->EndRoll(&loot, GetMap());
|
||||
group->EndRoll(m_loot.get(), GetMap());
|
||||
|
||||
m_groupLootTimer = 0;
|
||||
lootingGroupLowGUID.Clear();
|
||||
@@ -1269,7 +1265,7 @@ void GameObject::Update(uint32 diff)
|
||||
return;
|
||||
}
|
||||
|
||||
loot.clear();
|
||||
m_loot = nullptr;
|
||||
|
||||
// Do not delete chests or goobers that are not consumed on loot, while still allowing them to despawn when they expire if summoned
|
||||
bool isSummonedAndExpired = (GetOwner() || GetSpellId()) && m_respawnTime == 0;
|
||||
|
||||
Reference in New Issue
Block a user