aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-06 14:01:44 -0600
committermegamage <none@none>2008-12-06 14:01:44 -0600
commitc5593ef779a4ba7bbe9df391bc0defd3bf6c33a1 (patch)
treeae0cb37bc8f5de0d33bddae95747d7d2162cd8ce /src/game/Player.cpp
parent72edfea129c244cde9a18b3227f775250197ec99 (diff)
*Update to Mangos 6880. Source: Mangos.
*Skip 6878, 6871. *Main change: change cell size, add is3dDistance for IsWithinDistInMap and isVisibleForOrDetect. --HG-- branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 05204fe9c78..ac250640025 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17459,7 +17459,7 @@ void Player::ReportedAfkBy(Player* reporter)
}
}
-bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList) const
+bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool is3dDistance) const
{
// Always can see self
if (u == this)
@@ -17498,24 +17498,24 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList) cons
// different visible distance checks
if(isInFlight()) // what see player in flight
{
- if (!target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceInFlight()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f)))
+ if (!target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceInFlight()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance))
return false;
}
else if(!u->isAlive()) // distance for show body
{
- if (!target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f)))
+ if (!target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance))
return false;
}
else if(u->GetTypeId()==TYPEID_PLAYER) // distance for show player
{
// Players far than max visible distance for player or not in our map are not visible too
- if (!at_same_transport && !target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForPlayer()+(inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f)))
+ if (!at_same_transport && !target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForPlayer()+(inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance))
return false;
}
else if(u->GetCharmerOrOwnerGUID()) // distance for show pet/charmed
{
// Pet/charmed far than max visible distance for player or not in our map are not visible too
- if (!target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForPlayer()+(inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f)))
+ if (!target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForPlayer()+(inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance))
return false;
}
else // distance for show creature
@@ -17523,7 +17523,7 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList) cons
// Units far than max visible distance for creature or not in our map are not visible too
if (!target->IsWithinDistInMap(u, u->isActive()
? (MAX_VISIBILITY_DISTANCE - (inVisibleList ? 0.0f : World::GetVisibleUnitGreyDistance()))
- : (World::GetMaxVisibleDistanceForCreature() + (inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f))))
+ : (World::GetMaxVisibleDistanceForCreature() + (inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance)))
return false;
}