diff options
Diffstat (limited to 'core/object')
| -rw-r--r-- | core/object/message_queue.cpp | 13 | ||||
| -rw-r--r-- | core/object/script_language.cpp | 9 | ||||
| -rw-r--r-- | core/object/script_language.h | 1 |
3 files changed, 12 insertions, 11 deletions
diff --git a/core/object/message_queue.cpp b/core/object/message_queue.cpp index 22ed8b4378..ebed6c21e9 100644 --- a/core/object/message_queue.cpp +++ b/core/object/message_queue.cpp @@ -114,11 +114,7 @@ Error MessageQueue::push_set(Object *p_object, const StringName &p_prop, const V Error MessageQueue::push_callablep(const Callable &p_callable, const Variant **p_args, int p_argcount, bool p_show_error) { _THREAD_SAFE_METHOD_ - Vector<Variant> bound_arguments; - int bound_argcount = 0; - p_callable.get_bound_arguments_ref(bound_arguments, bound_argcount); - - int room_needed = sizeof(Message) + sizeof(Variant) * (bound_argcount + p_argcount); + int room_needed = sizeof(Message) + sizeof(Variant) * p_argcount; if ((buffer_end + room_needed) >= buffer_size) { print_line("Failed method: " + p_callable); @@ -127,7 +123,7 @@ Error MessageQueue::push_callablep(const Callable &p_callable, const Variant **p } Message *msg = memnew_placement(&buffer[buffer_end], Message); - msg->args = bound_argcount + p_argcount; + msg->args = p_argcount; msg->callable = p_callable; msg->type = TYPE_CALL; if (p_show_error) { @@ -136,11 +132,6 @@ Error MessageQueue::push_callablep(const Callable &p_callable, const Variant **p buffer_end += sizeof(Message); - for (int i = 0; i < bound_argcount; i++) { - Variant *v = memnew_placement(&buffer[buffer_end], Variant); - buffer_end += sizeof(Variant); - *v = bound_arguments[i]; - } for (int i = 0; i < p_argcount; i++) { Variant *v = memnew_placement(&buffer[buffer_end], Variant); buffer_end += sizeof(Variant); diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index c9cfbdd4cb..66ef418e42 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -263,6 +263,15 @@ void ScriptServer::remove_global_class(const StringName &p_class) { global_classes.erase(p_class); } +void ScriptServer::remove_global_class_by_path(const String &p_path) { + for (const KeyValue<StringName, GlobalScriptClass> &kv : global_classes) { + if (kv.value.path == p_path) { + global_classes.erase(kv.key); + return; + } + } +} + bool ScriptServer::is_global_class(const StringName &p_class) { return global_classes.has(p_class); } diff --git a/core/object/script_language.h b/core/object/script_language.h index ff678bcd25..02d1880dc2 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -80,6 +80,7 @@ public: static void global_classes_clear(); static void add_global_class(const StringName &p_class, const StringName &p_base, const StringName &p_language, const String &p_path); static void remove_global_class(const StringName &p_class); + static void remove_global_class_by_path(const String &p_path); static bool is_global_class(const StringName &p_class); static StringName get_global_class_language(const StringName &p_class); static String get_global_class_path(const String &p_class); |