summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-07-15 22:42:00 +0200
committermadmaxoft <github@xoft.cz>2014-07-15 22:42:00 +0200
commit3f8ec7699f0205a0346c32df49e2faf509995850 (patch)
treeb61f06d0001d3fd3238f80b5a2304595bbb28c6e /src/World.cpp
parentRestructured cSplashPotionEntity code. (diff)
parentMerge pull request #1191 from Masy98/Blocks (diff)
downloadcuberite-3f8ec7699f0205a0346c32df49e2faf509995850.tar
cuberite-3f8ec7699f0205a0346c32df49e2faf509995850.tar.gz
cuberite-3f8ec7699f0205a0346c32df49e2faf509995850.tar.bz2
cuberite-3f8ec7699f0205a0346c32df49e2faf509995850.tar.lz
cuberite-3f8ec7699f0205a0346c32df49e2faf509995850.tar.xz
cuberite-3f8ec7699f0205a0346c32df49e2faf509995850.tar.zst
cuberite-3f8ec7699f0205a0346c32df49e2faf509995850.zip
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/World.cpp b/src/World.cpp
index ba8add8f0..bd3613ce2 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -2468,10 +2468,13 @@ 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)
{
- ClosestDistance = Distance;
- ClosestPlayer = *itr;
+ if(!LineOfSight.Trace(a_Pos,(Pos - a_Pos),(int)(Pos - a_Pos).Length()))
+ {
+ ClosestDistance = Distance;
+ ClosestPlayer = *itr;
+ }
}
else
{