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

View file

@ -761,7 +761,7 @@ void Group::StartLootRool(WorldObject* lootTarget, LootMethod method, Loot* loot
if (lootItem.AllowedForPlayer(playerToRoll))
{
if (playerToRoll->IsWithinDist(lootTarget, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
if (playerToRoll->IsWithinDistInMap(lootTarget, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
{
r->playerVote[playerToRoll->GetObjectGuid()] = ROLL_NOT_EMITED_YET;
++r->totalPlayersRolling;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11948"
#define REVISION_NR "11949"
#endif // __REVISION_NR_H__