You've already forked godot
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user