From 3b2dfae5af9759da31516de25fcae12001092bb0 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 22 Jul 2017 16:57:56 -0300 Subject: function to add script and instance at once, as needed by neikeq --- core/object.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/object.cpp') diff --git a/core/object.cpp b/core/object.cpp index 000cefcac..316c62426 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -993,6 +993,17 @@ void Object::cancel_delete() { _predelete_ok = true; } +void Object::set_script_and_instance(const RefPtr &p_script, ScriptInstance *p_instance) { + + //this function is not meant to be used in any of these ways + ERR_FAIL_COND(p_script.is_null()); + ERR_FAIL_COND(!p_instance); + ERR_FAIL_COND(script_instance != NULL || !script.is_null()); + + script = p_script; + script_instance = p_instance; +} + void Object::set_script(const RefPtr &p_script) { if (script == p_script) -- cgit v1.2.3-70-g09d2