Updated Toy after a bugfix

This commit is contained in:
2023-06-15 12:45:07 +10:00
parent 1172ad50b4
commit 4d64d72a8f
2 changed files with 11 additions and 4 deletions

View File

@@ -130,14 +130,21 @@ fn depthComparator(lhs: opaque, rhs: opaque) { //for sorting by depth
var lhsPos = lhs.callNodeFn("getRealPos");
var rhsPos = rhs.callNodeFn("getRealPos");
var result = null;
if (lhsPos[1] == rhsPos[1]) { //BUGFIX: prevent z-fighting
if (lhsPos[0] == rhsPos[0]) {
return true;
result = true;
}
return lhsPos[0] < rhsPos[0];
else {
result = lhsPos[0] < rhsPos[0];
}
}
else {
result = lhsPos[1] < rhsPos[1];
}
return lhsPos[1] < rhsPos[1];
return result;
}
fn getCameraPos(node: opaque) {