Core/Misc: Fixed some duplicate checks for player typeid in Unit::Kill and Spell::EffectSummonDeadPet. Also some random cleanup
This commit is contained in:
1 parent
b10477a166
commit
11fb0beaf0
5 files changed
+31
-47
No files matched your search
@@ -1642,7 +1642,7 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
||||
bool corpseVisibility = false;
|
||||
if (distanceCheck)
|
||||
{
|
||||
if (const Player* thisPlayer = ToPlayer())
|
||||
if (Player const* thisPlayer = ToPlayer())
|
||||
{
|
||||
if (thisPlayer->isDead() && thisPlayer->GetHealth() > 0 && // Cheap way to check for ghost state
|
||||
!(obj->m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GHOST) & m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GHOST) & GHOST_VISIBILITY_GHOST))
|
||||
@@ -1675,9 +1675,9 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
||||
if (!corpseVisibility && !(obj->m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GHOST) & m_serverSideVisibilityDetect.GetValue(SERVERSIDE_VISIBILITY_GHOST)))
|
||||
{
|
||||
// Alive players can see dead players in some cases, but other objects can't do that
|
||||
if (const Player* thisPlayer = ToPlayer())
|
||||
if (Player const* thisPlayer = ToPlayer())
|
||||
{
|
||||
if (const Player* objPlayer = obj->ToPlayer())
|
||||
if (Player const* objPlayer = obj->ToPlayer())
|
||||
{
|
||||
if (thisPlayer->GetTeam() != objPlayer->GetTeam() || !thisPlayer->IsGroupVisibleFor(objPlayer))
|
||||
return false;
|
||||
@@ -2018,7 +2018,6 @@ void WorldObject::SendMessageToSet(WorldPacket* data, bool self)
|
||||
SendMessageToSetInRange(data, GetVisibilityRange(), self);
|
||||
}
|
||||
|
||||
|
||||
void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*self*/)
|
||||
{
|
||||
Trinity::MessageDistDeliverer notifier(this, data, dist);
|
||||
|
||||
Reference in new issue
Block a user