diff options
author | click <none@none> | 2010-04-21 23:15:29 +0200 |
---|---|---|
committer | click <none@none> | 2010-04-21 23:15:29 +0200 |
commit | b31d567bfd1e9c35a81e071b6aa1d4962ceffb67 (patch) | |
tree | 112ccabb3128020456451378312114981996f64c /src/game/Player.cpp | |
parent | 12950d1c165204e46b735c0f1a58bb97834be647 (diff) |
Change visibility of pets or charmed units as well when GM is invisible
Fix by liberate
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 45bf0867cbb..c25810a95c7 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -20130,17 +20130,20 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool return false; } - if (u->GetVisibility() == VISIBILITY_OFF) + if (Unit* owner = u->GetCharmerOrOwnerOrSelf()) { - // GMs see any players, not higher GMs and all units - if (isGameMaster()) + if (owner->GetVisibility() == VISIBILITY_OFF) { - if (u->GetTypeId() == TYPEID_PLAYER) - return u->ToPlayer()->GetSession()->GetSecurity() <= GetSession()->GetSecurity(); - else - return true; + // GMs see any players, not higher GMs and all units + if (isGameMaster()) + { + if (owner->GetTypeId() == TYPEID_PLAYER) + return owner->ToPlayer()->GetSession()->GetSecurity() <= GetSession()->GetSecurity(); + else + return true; + } + return false; } - return false; } // GM's can see everyone with invisibilitymask with less or equal security level |