mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Change inequality comparison operators to use exact equality
This commit is contained in:
@@ -322,8 +322,8 @@ bool Vector3::operator!=(const Vector3 &p_v) const {
|
||||
}
|
||||
|
||||
bool Vector3::operator<(const Vector3 &p_v) const {
|
||||
if (Math::is_equal_approx(x, p_v.x)) {
|
||||
if (Math::is_equal_approx(y, p_v.y)) {
|
||||
if (x == p_v.x) {
|
||||
if (y == p_v.y) {
|
||||
return z < p_v.z;
|
||||
} else {
|
||||
return y < p_v.y;
|
||||
@@ -334,8 +334,8 @@ bool Vector3::operator<(const Vector3 &p_v) const {
|
||||
}
|
||||
|
||||
bool Vector3::operator>(const Vector3 &p_v) const {
|
||||
if (Math::is_equal_approx(x, p_v.x)) {
|
||||
if (Math::is_equal_approx(y, p_v.y)) {
|
||||
if (x == p_v.x) {
|
||||
if (y == p_v.y) {
|
||||
return z > p_v.z;
|
||||
} else {
|
||||
return y > p_v.y;
|
||||
@@ -346,8 +346,8 @@ bool Vector3::operator>(const Vector3 &p_v) const {
|
||||
}
|
||||
|
||||
bool Vector3::operator<=(const Vector3 &p_v) const {
|
||||
if (Math::is_equal_approx(x, p_v.x)) {
|
||||
if (Math::is_equal_approx(y, p_v.y)) {
|
||||
if (x == p_v.x) {
|
||||
if (y == p_v.y) {
|
||||
return z <= p_v.z;
|
||||
} else {
|
||||
return y < p_v.y;
|
||||
@@ -358,8 +358,8 @@ bool Vector3::operator<=(const Vector3 &p_v) const {
|
||||
}
|
||||
|
||||
bool Vector3::operator>=(const Vector3 &p_v) const {
|
||||
if (Math::is_equal_approx(x, p_v.x)) {
|
||||
if (Math::is_equal_approx(y, p_v.y)) {
|
||||
if (x == p_v.x) {
|
||||
if (y == p_v.y) {
|
||||
return z >= p_v.z;
|
||||
} else {
|
||||
return y > p_v.y;
|
||||
|
||||
Reference in New Issue
Block a user