parent
c3b0a92c3c
commit
9c6c2f09e0
|
@ -836,14 +836,16 @@ void Object::set_script(const Variant &p_script) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ref<Script> s = p_script;
|
||||||
|
ERR_FAIL_COND_MSG(s.is_null() && !p_script.is_null(), "Invalid parameter, it should be a reference to a valid script (or null).");
|
||||||
|
|
||||||
|
script = p_script;
|
||||||
|
|
||||||
if (script_instance) {
|
if (script_instance) {
|
||||||
memdelete(script_instance);
|
memdelete(script_instance);
|
||||||
script_instance = nullptr;
|
script_instance = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
script = p_script;
|
|
||||||
Ref<Script> s = script;
|
|
||||||
|
|
||||||
if (!s.is_null()) {
|
if (!s.is_null()) {
|
||||||
if (s->can_instantiate()) {
|
if (s->can_instantiate()) {
|
||||||
OBJ_DEBUG_LOCK
|
OBJ_DEBUG_LOCK
|
||||||
|
|
Loading…
Reference in New Issue