[11650] Group members see same group member ghosts.

Also drop battleground case that just same check in fact.

Original patch and research provided by Den.
This commit is contained in:
VladimirMangos 2011-06-19 03:58:51 +04:00
parent 17b7e3b32c
commit 45292a9d56
2 changed files with 10 additions and 17 deletions

View file

@ -19837,35 +19837,28 @@ void Player::ReportedAfkBy(Player* reporter)
bool Player::IsVisibleInGridForPlayer( Player* pl ) const bool Player::IsVisibleInGridForPlayer( Player* pl ) const
{ {
// gamemaster in GM mode see all, including ghosts // gamemaster in GM mode see all, including ghosts
if(pl->isGameMaster() && GetSession()->GetSecurity() <= pl->GetSession()->GetSecurity()) if (pl->isGameMaster() && GetSession()->GetSecurity() <= pl->GetSession()->GetSecurity())
return true; return true;
// It seems in battleground everyone sees everyone, except the enemy-faction ghosts // player see dead player/ghost from own group/raid
if (InBattleGround()) if (IsInSameRaidWith(pl))
{
if (!(isAlive() || m_deathTimer > 0) && !IsFriendlyTo(pl) )
return false;
return true; return true;
}
// Live player see live player or dead player with not realized corpse // Live player see live player or dead player with not realized corpse
if(pl->isAlive() || pl->m_deathTimer > 0) if (pl->isAlive() || pl->m_deathTimer > 0)
{
return isAlive() || m_deathTimer > 0; return isAlive() || m_deathTimer > 0;
}
// Ghost see other friendly ghosts, that's for sure // Ghost see other friendly ghosts, that's for sure
if(!(isAlive() || m_deathTimer > 0) && IsFriendlyTo(pl)) if (!(isAlive() || m_deathTimer > 0) && IsFriendlyTo(pl))
return true; return true;
// Dead player see live players near own corpse // Dead player see live players near own corpse
if(isAlive()) if (isAlive())
{ {
Corpse *corpse = pl->GetCorpse(); if (Corpse *corpse = pl->GetCorpse())
if(corpse)
{ {
// 20 - aggro distance for same level, 25 - max additional distance if player level less that creature level // 20 - aggro distance for same level, 25 - max additional distance if player level less that creature level
if(corpse->IsWithinDistInMap(this,(20+25)*sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO))) if (corpse->IsWithinDistInMap(this, (20 + 25) * sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO)))
return true; return true;
} }
} }
@ -19876,7 +19869,7 @@ bool Player::IsVisibleInGridForPlayer( Player* pl ) const
bool Player::IsVisibleGloballyFor( Player* u ) const bool Player::IsVisibleGloballyFor( Player* u ) const
{ {
if(!u) if (!u)
return false; return false;
// Always can see self // Always can see self

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11649" #define REVISION_NR "11650"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__