diff options
author | Mattes D <github@xoft.cz> | 2014-07-15 14:12:17 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-07-15 14:12:17 +0200 |
commit | 090cbad667b7ac56568cbb0a9d99dca9b8fa5e6b (patch) | |
tree | 2020d8860b75aa5a8247b048e13a497a143ca6af | |
parent | Pass cItem by reference. (diff) | |
parent | Fixed FindClosestPlayer (diff) | |
download | cuberite-090cbad667b7ac56568cbb0a9d99dca9b8fa5e6b.tar cuberite-090cbad667b7ac56568cbb0a9d99dca9b8fa5e6b.tar.gz cuberite-090cbad667b7ac56568cbb0a9d99dca9b8fa5e6b.tar.bz2 cuberite-090cbad667b7ac56568cbb0a9d99dca9b8fa5e6b.tar.lz cuberite-090cbad667b7ac56568cbb0a9d99dca9b8fa5e6b.tar.xz cuberite-090cbad667b7ac56568cbb0a9d99dca9b8fa5e6b.tar.zst cuberite-090cbad667b7ac56568cbb0a9d99dca9b8fa5e6b.zip |
Diffstat (limited to '')
-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 { |