1
0

Fixed FindClosestPlayer

This commit is contained in:
Tycho 2014-07-15 12:52:02 +01:00
parent e2a1118f88
commit 57f4e871bb

View File

@ -2468,10 +2468,13 @@ cPlayer * cWorld::FindClosestPlayer(const Vector3d & a_Pos, float a_SightLimit,
if (Distance < ClosestDistance) if (Distance < ClosestDistance)
{ {
if (a_CheckLineOfSight && !LineOfSight.Trace(a_Pos,(Pos - a_Pos),(int)(Pos - a_Pos).Length())) if (a_CheckLineOfSight)
{ {
ClosestDistance = Distance; if(!LineOfSight.Trace(a_Pos,(Pos - a_Pos),(int)(Pos - a_Pos).Length()))
ClosestPlayer = *itr; {
ClosestDistance = Distance;
ClosestPlayer = *itr;
}
} }
else else
{ {