mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-01 22:56:39 +01:00
Fix Object::IsInMap to check instanceId.
Fig group loot distance checks to also check map instanceId. Fixes issue #1172. --HG-- branch : trunk
This commit is contained in:
@@ -609,7 +609,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject)
|
||||
continue;
|
||||
if (i->AllowedForPlayer(member))
|
||||
{
|
||||
if (member->IsWithinDist(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (member->IsWithinDistInMap(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
{
|
||||
r->playerVote[member->GetGUID()] = NOT_EMITED_YET;
|
||||
r->totalPlayersRolling++;
|
||||
@@ -674,7 +674,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject)
|
||||
|
||||
if (playerToRoll->CanUseItem(item) && i->AllowedForPlayer(playerToRoll))
|
||||
{
|
||||
if (playerToRoll->IsWithinDist(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (playerToRoll->IsWithinDistInMap(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
{
|
||||
r->playerVote[playerToRoll->GetGUID()] = NOT_EMITED_YET;
|
||||
r->totalPlayersRolling++;
|
||||
@@ -724,7 +724,7 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject)
|
||||
if (!looter->IsInWorld())
|
||||
continue;
|
||||
|
||||
if (looter->IsWithinDist(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (looter->IsWithinDistInMap(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
{
|
||||
data << looter->GetGUID();
|
||||
++real_count;
|
||||
@@ -736,7 +736,7 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject)
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *looter = itr->getSource();
|
||||
if (looter->IsWithinDist(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (looter->IsWithinDistInMap(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
looter->GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
@@ -1437,7 +1437,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
|
||||
{
|
||||
// not update if only update if need and ok
|
||||
Player* looter = ObjectAccessor::FindPlayer(guid_itr->guid);
|
||||
if (looter && looter->IsWithinDist(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (looter && looter->IsWithinDistInMap(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
return;
|
||||
}
|
||||
++guid_itr;
|
||||
@@ -1448,7 +1448,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
|
||||
for (member_citerator itr = guid_itr; itr != m_memberSlots.end(); ++itr)
|
||||
{
|
||||
if (Player* pl = ObjectAccessor::FindPlayer(itr->guid))
|
||||
if (pl->IsWithinDist(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (pl->IsWithinDistInMap(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
{
|
||||
pNewLooter = pl;
|
||||
break;
|
||||
@@ -1461,7 +1461,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
|
||||
for (member_citerator itr = m_memberSlots.begin(); itr != guid_itr; ++itr)
|
||||
{
|
||||
if (Player* pl = ObjectAccessor::FindPlayer(itr->guid))
|
||||
if (pl->IsWithinDist(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
if (pl->IsWithinDistInMap(pLootedObject,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
{
|
||||
pNewLooter = pl;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user