RID: Change comparison operators to use RID_Data id instead of address

This should helps making sorting more deterministic in physics and rendering.

The same change was done for 4.0 in 4f163972bb.
This commit is contained in:
Rémi Verschelde 2022-03-17 11:03:03 +01:00
parent 88e2c513e7
commit 797321fec4

View file

@ -68,13 +68,13 @@ public:
return _data == p_rid._data; return _data == p_rid._data;
} }
_FORCE_INLINE_ bool operator<(const RID &p_rid) const { _FORCE_INLINE_ bool operator<(const RID &p_rid) const {
return _data < p_rid._data; return get_id() < p_rid.get_id();
} }
_FORCE_INLINE_ bool operator<=(const RID &p_rid) const { _FORCE_INLINE_ bool operator<=(const RID &p_rid) const {
return _data <= p_rid._data; return get_id() <= p_rid.get_id();
} }
_FORCE_INLINE_ bool operator>(const RID &p_rid) const { _FORCE_INLINE_ bool operator>(const RID &p_rid) const {
return _data > p_rid._data; return get_id() > p_rid.get_id();
} }
_FORCE_INLINE_ bool operator!=(const RID &p_rid) const { _FORCE_INLINE_ bool operator!=(const RID &p_rid) const {
return _data != p_rid._data; return _data != p_rid._data;