diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-07-15 13:52:02 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-07-15 13:52:02 +0200 |
commit | 57f4e871bb820beaf56ee48e762a1ee276aa8afe (patch) | |
tree | 2020d8860b75aa5a8247b048e13a497a143ca6af /src/World.cpp | |
parent | Pass cItem by reference. (diff) | |
download | cuberite-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/World.cpp')
-rw-r--r-- | src/World.cpp | 9 |
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 { |