Fixed FindClosestPlayer
This commit is contained in:
parent
e2a1118f88
commit
57f4e871bb
@ -2468,11 +2468,14 @@ cPlayer * cWorld::FindClosestPlayer(const Vector3d & a_Pos, float a_SightLimit,
|
||||
|
||||
if (Distance < ClosestDistance)
|
||||
{
|
||||
if (a_CheckLineOfSight && !LineOfSight.Trace(a_Pos,(Pos - a_Pos),(int)(Pos - a_Pos).Length()))
|
||||
if (a_CheckLineOfSight)
|
||||
{
|
||||
if(!LineOfSight.Trace(a_Pos,(Pos - a_Pos),(int)(Pos - a_Pos).Length()))
|
||||
{
|
||||
ClosestDistance = Distance;
|
||||
ClosestPlayer = *itr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClosestDistance = Distance;
|
||||
|
Loading…
Reference in New Issue
Block a user