[7758] Fixed gain reputation and xp reward between group mates in differents instances

Signed-off-by: AlexDereka <dereka.alex@gmail.com>
This commit is contained in:
zhenya 2009-05-04 14:45:11 +04:00 committed by AlexDereka
parent 15d449c161
commit b1bfdddeb2
2 changed files with 7 additions and 4 deletions

View file

@ -18700,14 +18700,17 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
{
if(pRewardSource->GetDistance(this) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE))
if (GetInstanceId() != pRewardSource->GetInstanceId())
return false;
if (pRewardSource->GetDistance(this) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE))
return true;
if(isAlive())
if (isAlive())
return false;
Corpse* corpse = GetCorpse();
if(!corpse)
if (!corpse)
return false;
return pRewardSource->GetDistance(corpse) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE);