Browse Source

Fix NEQ operation between 2 different Arrays

it was returning false if it found the same content in both arrays which isn't correct, it should return true when it finds different values
MrCdK 7 years ago
parent
commit
b2617e72e5
1 changed files with 4 additions and 4 deletions
  1. 4 4
      core/variant_op.cpp

+ 4 - 4
core/variant_op.cpp

@@ -339,7 +339,7 @@ bool Variant::booleanize() const {
 	CASE_TYPE(m_prefix, m_op_name, m_name) {                                                     \
 	CASE_TYPE(m_prefix, m_op_name, m_name) {                                                     \
 		if (p_b.type == NIL)                                                                     \
 		if (p_b.type == NIL)                                                                     \
 			_RETURN(true)                                                                        \
 			_RETURN(true)                                                                        \
-		DEFAULT_OP_ARRAY_OP_BODY(m_prefix, m_op_name, m_name, m_type, !=, ==, true, true, false) \
+		DEFAULT_OP_ARRAY_OP_BODY(m_prefix, m_op_name, m_name, m_type, !=, !=, false, true, true) \
 	}
 	}
 
 
 #define DEFAULT_OP_ARRAY_LT(m_prefix, m_op_name, m_name, m_type) \
 #define DEFAULT_OP_ARRAY_LT(m_prefix, m_op_name, m_name, m_type) \
@@ -539,12 +539,12 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a,
 				if (arr_b->size() != l)
 				if (arr_b->size() != l)
 					_RETURN(true);
 					_RETURN(true);
 				for (int i = 0; i < l; i++) {
 				for (int i = 0; i < l; i++) {
-					if (((*arr_a)[i] == (*arr_b)[i])) {
-						_RETURN(false);
+					if (((*arr_a)[i] != (*arr_b)[i])) {
+						_RETURN(true);
 					}
 					}
 				}
 				}
 
 
-				_RETURN(true);
+				_RETURN(false);
 			}
 			}
 
 
 			DEFAULT_OP_NUM_NULL(math, OP_NOT_EQUAL, INT, !=, _int);
 			DEFAULT_OP_NUM_NULL(math, OP_NOT_EQUAL, INT, !=, _int);