[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:
stfx 2012-04-02 19:18:41 +03:00 committed by Schmoozerd
parent 31e46daaf8
commit e79b80727d
3 changed files with 6 additions and 7 deletions

View file

@ -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();