summaryrefslogtreecommitdiff
path: root/src/raycast.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-08-19 14:25:35 +0200
committerGitHub <noreply@github.com>2017-08-19 14:25:35 +0200
commit7528986e4449febead9b18b6118f0b096f7cf800 (patch)
tree8e526c1403ba8d0689ab40a24165fc19d8a07e27 /src/raycast.cpp
parent1992db1395d9c068327a7c08bac7a24ef7112274 (diff)
downloadminetest-7528986e4449febead9b18b6118f0b096f7cf800.tar.gz
minetest-7528986e4449febead9b18b6118f0b096f7cf800.tar.bz2
minetest-7528986e4449febead9b18b6118f0b096f7cf800.zip
Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial) * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Spelling: vertice -> vertex
Diffstat (limited to 'src/raycast.cpp')
-rw-r--r--src/raycast.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/raycast.cpp b/src/raycast.cpp
index 42cc22587..2dbebd83b 100644
--- a/src/raycast.cpp
+++ b/src/raycast.cpp
@@ -31,13 +31,15 @@ bool RaycastSort::operator() (const PointedThing &pt1,
// returns false if pt1 is nearer than pt2
if (pt1.distanceSq < pt2.distanceSq) {
return false;
- } else if (pt1.distanceSq == pt2.distanceSq) {
+ }
+
+ if (pt1.distanceSq == pt2.distanceSq) {
// Sort them to allow only one order
if (pt1.type == POINTEDTHING_OBJECT)
return (pt2.type == POINTEDTHING_OBJECT
&& pt1.object_id < pt2.object_id);
- else
- return (pt2.type == POINTEDTHING_OBJECT
+
+ return (pt2.type == POINTEDTHING_OBJECT
|| pt1.node_undersurface < pt2.node_undersurface);
}
return true;