We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6cb37a8 + 924483f commit 7dad97cCopy full SHA for 7dad97c
godot-core/src/obj/script.rs
@@ -360,9 +360,10 @@ where
360
return false;
361
}
362
363
- let object_script: Gd<Script> = object_script_variant.to();
364
-
365
- if object_script.upcast_ref::<Script>().__object_ptr() != script.upcast_ref().__object_ptr() {
+ if object_script_variant
+ .object_id()
+ .map_or(true, |instance_id| instance_id != script.instance_id())
366
+ {
367
368
369
@@ -371,6 +372,8 @@ where
371
372
};
373
374
let get_instance_fn = sys::interface_fn!(object_get_script_instance);
375
+
376
+ // SAFETY: Object and language are alive and their sys pointers are valid.
377
let instance = unsafe { get_instance_fn(object.obj_sys(), language.obj_sys()) };
378
379
!instance.is_null()
0 commit comments