Change visibility of pets or charmed units as well when GM is invisible

Fix by liberate

--HG--
branch : trunk
This commit is contained in:
click
2010-04-21 23:15:29 +02:00
parent 12950d1c16
commit b31d567bfd
+11 -8
View File
@@ -20130,17 +20130,20 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool
return false; return false;
} }
if (u->GetVisibility() == VISIBILITY_OFF) if (Unit* owner = u->GetCharmerOrOwnerOrSelf())
{ {
// GMs see any players, not higher GMs and all units if (owner->GetVisibility() == VISIBILITY_OFF)
if (isGameMaster())
{ {
if (u->GetTypeId() == TYPEID_PLAYER) // GMs see any players, not higher GMs and all units
return u->ToPlayer()->GetSession()->GetSecurity() <= GetSession()->GetSecurity(); if (isGameMaster())
else {
return true; 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 // GM's can see everyone with invisibilitymask with less or equal security level