mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11948"
|
||||
#define REVISION_NR "11949"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue