mirror of
https://github.com/mangosfour/server.git
synced 2025-12-19 04:37:06 +00:00
[11949] Check group id of group loot timer when timer is started. Close pull request #39
Also fix a small possible bug with loot shared to players at similar position on a different map Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
31e46daaf8
commit
e79b80727d
3 changed files with 6 additions and 7 deletions
|
|
@ -356,7 +356,7 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/)
|
|||
ResetDoorOrButton();
|
||||
break;
|
||||
case GAMEOBJECT_TYPE_CHEST:
|
||||
if (m_groupLootTimer)
|
||||
if (m_groupLootId)
|
||||
{
|
||||
if (m_groupLootTimer <= update_diff)
|
||||
StopGroupLoot();
|
||||
|
|
@ -1820,14 +1820,13 @@ void GameObject::SetDisplayId(uint32 modelId)
|
|||
void GameObject::StartGroupLoot(Group* group, uint32 timer)
|
||||
{
|
||||
m_groupLootId = group->GetId();
|
||||
m_groupLootTimer = timer;
|
||||
|
||||
if (m_groupLootId)
|
||||
m_groupLootTimer = timer;
|
||||
}
|
||||
|
||||
void GameObject::StopGroupLoot()
|
||||
{
|
||||
if (!m_groupLootId)
|
||||
return;
|
||||
|
||||
if (Group* group = sObjectMgr.GetGroupById(m_groupLootId))
|
||||
group->EndRoll();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue