mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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
This commit is contained in:
parent
1992db1395
commit
7528986e44
28 changed files with 363 additions and 443 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue