Browse Source

Fixed process priority

Andrea Catania 7 years ago
parent
commit
c1860fe88b
2 changed files with 1 additions and 7 deletions
  1. 0 5
      scene/main/node.cpp
  2. 1 2
      scene/main/node.h

+ 0 - 5
scene/main/node.cpp

@@ -1415,11 +1415,6 @@ bool Node::is_greater_than(const Node *p_node) const {
 	return res;
 }
 
-bool Node::has_priority_higher_than(const Node *p_node) const {
-	ERR_FAIL_NULL_V(p_node, false);
-	return data.process_priority > p_node->data.process_priority;
-}
-
 void Node::get_owned_by(Node *p_by, List<Node *> *p_owned) {
 
 	if (data.owner == p_by)

+ 1 - 2
scene/main/node.h

@@ -72,7 +72,7 @@ public:
 
 	struct ComparatorWithPriority {
 
-		bool operator()(const Node *p_a, const Node *p_b) const { return p_b->has_priority_higher_than(p_a) || p_b->is_greater_than(p_a); }
+		bool operator()(const Node *p_a, const Node *p_b) const { return p_b->data.process_priority == p_a->data.process_priority ? p_b->is_greater_than(p_a) : p_b->data.process_priority > p_a->data.process_priority; }
 	};
 
 private:
@@ -265,7 +265,6 @@ public:
 
 	bool is_a_parent_of(const Node *p_node) const;
 	bool is_greater_than(const Node *p_node) const;
-	bool has_priority_higher_than(const Node *p_node) const;
 
 	NodePath get_path() const;
 	NodePath get_path_to(const Node *p_node) const;