summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-07-15 13:52:02 +0200
committerTycho <work.tycho+git@gmail.com>2014-07-15 13:52:02 +0200
commit57f4e871bb820beaf56ee48e762a1ee276aa8afe (patch)
tree2020d8860b75aa5a8247b048e13a497a143ca6af /src
parentPass cItem by reference. (diff)
downloadcuberite-57f4e871bb820beaf56ee48e762a1ee276aa8afe.tar
cuberite-57f4e871bb820beaf56ee48e762a1ee276aa8afe.tar.gz
cuberite-57f4e871bb820beaf56ee48e762a1ee276aa8afe.tar.bz2
cuberite-57f4e871bb820beaf56ee48e762a1ee276aa8afe.tar.lz
cuberite-57f4e871bb820beaf56ee48e762a1ee276aa8afe.tar.xz
cuberite-57f4e871bb820beaf56ee48e762a1ee276aa8afe.tar.zst
cuberite-57f4e871bb820beaf56ee48e762a1ee276aa8afe.zip
Diffstat (limited to 'src')
-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
{