From 185cfb329110aac57b800adc2bac6f09d6bbd1e4 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 20 Mar 2022 20:22:15 +0100 Subject: [PATCH] Backported: 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 4f16397. - akien-mga - https://github.com/godotengine/godot/commit/797321fec45df71f1f7d4fcca4e9af30d11853b9 --- core/rid.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/rid.h b/core/rid.h index ea33946ee..7cbfc855b 100644 --- a/core/rid.h +++ b/core/rid.h @@ -67,13 +67,13 @@ public: return _data == p_rid._data; } _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 { - return _data <= p_rid._data; + return get_id() <= p_rid.get_id(); } _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 { return _data != p_rid._data;