aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-13 17:18:33 -0500
committermegamage <none@none>2009-04-13 17:18:33 -0500
commita5834f20085b07012ae73d16a6a25188f7f928a4 (patch)
tree5f2e97c3c0b0c004875652217824f07e2daebbfc /src/game/Player.cpp
parent0583b4bd047dba91d8fcdd221a1411658d733d3e (diff)
parentce9f023a9607f827ad2479e2df09ced6554f43b6 (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index b9f8edf2b66..237a8180d19 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17987,7 +17987,7 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool
return false;
}
- if(u->GetVisibility() == VISIBILITY_OFF || u->m_invisibilityMask )
+ if(u->GetVisibility() == VISIBILITY_OFF)
{
// GMs see any players, not higher GMs and all units
if(isGameMaster())
@@ -18000,13 +18000,25 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool
return false;
}
- // player see other player with stealth/invisibility only if he in same group or raid or same team (raid/team case dependent from conf setting)
- if((m_mover->m_invisibilityMask || u->m_invisibilityMask) && !m_mover->canDetectInvisibilityOf(u))
- if(!(u->GetTypeId()==TYPEID_PLAYER && !IsHostileTo(u) && IsGroupVisibleFor(((Player*)u))))
- return false;
+ // GM's can see everyone with invisibilitymask with less or equal security level
+ if(m_mover->m_invisibilityMask || u->m_invisibilityMask)
+ {
+ if(isGameMaster())
+ {
+ if(u->GetTypeId() == TYPEID_PLAYER)
+ return ((Player*)u)->GetSession()->GetSecurity() <= GetSession()->GetSecurity();
+ else
+ return true;
+ }
+
+ // player see other player with stealth/invisibility only if he in same group or raid or same team (raid/team case dependent from conf setting)
+ if(!m_mover->canDetectInvisibilityOf(u))
+ if(!(u->GetTypeId()==TYPEID_PLAYER && !IsHostileTo(u) && IsGroupVisibleFor(((Player*)u))))
+ return false;
+ }
// GM invisibility checks early, invisibility if any detectable, so if not stealth then visible
- if(u->GetVisibility() == VISIBILITY_GROUP_STEALTH)
+ if(u->GetVisibility() == VISIBILITY_GROUP_STEALTH && !isGameMaster())
{
// if player is dead then he can't detect anyone in any cases
//do not know what is the use of this detect