1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits.

This commit is contained in:
Juan Linietsky
2020-02-12 14:24:06 -03:00
parent 4aa31a2851
commit cf8c679a23
89 changed files with 337 additions and 287 deletions

View File

@@ -113,7 +113,7 @@ Reference::~Reference() {
Variant WeakRef::get_ref() const {
if (ref == 0)
if (ref.is_null())
return Variant();
Object *obj = ObjectDB::get_instance(ref);
@@ -129,16 +129,15 @@ Variant WeakRef::get_ref() const {
}
void WeakRef::set_obj(Object *p_object) {
ref = p_object ? p_object->get_instance_id() : 0;
ref = p_object ? p_object->get_instance_id() : ObjectID();
}
void WeakRef::set_ref(const REF &p_ref) {
ref = p_ref.is_valid() ? p_ref->get_instance_id() : 0;
ref = p_ref.is_valid() ? p_ref->get_instance_id() : ObjectID();
}
WeakRef::WeakRef() :
ref(0) {
WeakRef::WeakRef() {
}
void WeakRef::_bind_methods() {