mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[9327] Replace leader based indexing groups by group ids.
* This must repolve problem with loot. Before if some mob killed by group member and then leader changed then group members can't loot this mob body. * Possible resolve crashes at loot. Now group storage content not dependent from leader changes.
This commit is contained in:
parent
5a7eb09bd2
commit
8e0069f364
8 changed files with 66 additions and 42 deletions
|
|
@ -113,7 +113,7 @@ bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
|||
|
||||
Creature::Creature(CreatureSubtype subtype) :
|
||||
Unit(), i_AI(NULL),
|
||||
lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), lootingGroupLeaderGUID(0),
|
||||
lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), m_groupLootId(0),
|
||||
m_lootMoney(0), m_lootRecipient(0),
|
||||
m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(0.0f),
|
||||
m_subtype(subtype), m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0),
|
||||
|
|
@ -395,7 +395,7 @@ void Creature::Update(uint32 diff)
|
|||
else
|
||||
{
|
||||
m_deathTimer -= diff;
|
||||
if (m_groupLootTimer && lootingGroupLeaderGUID)
|
||||
if (m_groupLootTimer && m_groupLootId)
|
||||
{
|
||||
if(diff <= m_groupLootTimer)
|
||||
{
|
||||
|
|
@ -403,10 +403,10 @@ void Creature::Update(uint32 diff)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Group* group = sObjectMgr.GetGroupByLeaderLowGUID(GUID_LOPART(lootingGroupLeaderGUID)))
|
||||
if (Group* group = sObjectMgr.GetGroupById(m_groupLootId))
|
||||
group->EndRoll();
|
||||
m_groupLootTimer = 0;
|
||||
lootingGroupLeaderGUID = 0;
|
||||
m_groupLootId = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue