diff --git a/core/reference.h b/core/reference.h index 0d6b1ced6ea..25e02180fa9 100644 --- a/core/reference.h +++ b/core/reference.h @@ -87,6 +87,13 @@ class Ref { //virtual Reference * get_reference() const { return reference; } public: + _FORCE_INLINE_ bool operator==(const T *p_ptr) const { + return reference == p_ptr; + } + _FORCE_INLINE_ bool operator!=(const T *p_ptr) const { + return reference != p_ptr; + } + _FORCE_INLINE_ bool operator<(const Ref &p_r) const { return reference < p_r.reference; diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index d6c22d5664d..143a1438ea0 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -34,7 +34,7 @@ void Material::set_next_pass(const Ref &p_pass) { - ERR_FAIL_COND(p_pass.ptr() == this); + ERR_FAIL_COND(p_pass == this); if (next_pass == p_pass) return;