Revert "Make freed object different than null in comparison operators"

This reverts commit 150b50cfcd.

As discussed with the GDScript team, this has some implications which aren't
fully consensual yet, and which we want to revisit.

For now we revert to the 4.2 behavior for the 4.3 release, to avoid breaking
user expectations.
This commit is contained in:
Rémi Verschelde
2024-07-01 14:11:43 +02:00
parent 446e7a7c22
commit 152d7c1bba
2 changed files with 17 additions and 17 deletions

View File

@@ -951,7 +951,7 @@ bool Variant::is_zero() const {
return *reinterpret_cast<const ::RID *>(_data._mem) == ::RID();
}
case OBJECT: {
return get_validated_object() == nullptr;
return _get_obj().obj == nullptr;
}
case CALLABLE: {
return reinterpret_cast<const Callable *>(_data._mem)->is_null();