diff options
author | Anubisss <none@none> | 2009-04-13 18:07:26 +0200 |
---|---|---|
committer | Anubisss <none@none> | 2009-04-13 18:07:26 +0200 |
commit | e15ae448c31989f105554be3a770f4c7c9f2737f (patch) | |
tree | 1a27982a196b4fd7ed86502d8509cc8fb978d853 /src | |
parent | dd93679f5f0d36705d5bd39fee4b0ec9e0ed5b2a (diff) |
Better way for allow GMs(in gm mode on) to see invisible or stealthed players by Machiavelli. Thank you.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index addabe73eeb..0078ed535d3 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -17637,7 +17637,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()) @@ -17650,13 +17650,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_invisibilityMask || u->m_invisibilityMask) && !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_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(!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 |