summaryrefslogtreecommitdiffstats
path: root/modules/gdnative/nativescript/nativescript.cpp
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2020-07-24 14:13:58 -0300
committerGeorge Marques <george@gmarqu.es>2020-07-24 14:13:58 -0300
commit2b9d9bc3644de19b291c16b2facc418f3d64d4fc (patch)
tree667e5ef0de74573f5933a0b65bf8d5917b282fe5 /modules/gdnative/nativescript/nativescript.cpp
parentb7dc08fcf6117bc13b0b1210119e51b4c51f5086 (diff)
downloadredot-engine-2b9d9bc3644de19b291c16b2facc418f3d64d4fc.tar.gz
Remove multilevel calls
In general they are more confusing to users because they expect inheritance to fully override parent methods. This behavior can be enabled by script writers using a simple super() call.
Diffstat (limited to 'modules/gdnative/nativescript/nativescript.cpp')
-rw-r--r--modules/gdnative/nativescript/nativescript.cpp28
1 files changed, 2 insertions, 26 deletions
diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp
index 94aa2125c2..632f4e5fee 100644
--- a/modules/gdnative/nativescript/nativescript.cpp
+++ b/modules/gdnative/nativescript/nativescript.cpp
@@ -991,7 +991,8 @@ void NativeScriptInstance::notification(int p_notification) {
Variant value = p_notification;
const Variant *args[1] = { &value };
- call_multilevel("_notification", args, 1);
+ Callable::CallError error;
+ call("_notification", args, 1, error);
}
String NativeScriptInstance::to_string(bool *r_valid) {
@@ -1087,31 +1088,6 @@ ScriptLanguage *NativeScriptInstance::get_language() {
return NativeScriptLanguage::get_singleton();
}
-void NativeScriptInstance::call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount) {
- NativeScriptDesc *script_data = GET_SCRIPT_DESC();
-
- while (script_data) {
- Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.find(p_method);
- if (E) {
- godot_variant res = E->get().method.method((godot_object *)owner,
- E->get().method.method_data,
- userdata,
- p_argcount,
- (godot_variant **)p_args);
- godot_variant_destroy(&res);
- }
- script_data = script_data->base_data;
- }
-}
-
-void NativeScriptInstance::call_multilevel_reversed(const StringName &p_method, const Variant **p_args, int p_argcount) {
- NativeScriptDesc *script_data = GET_SCRIPT_DESC();
-
- if (script_data) {
- _ml_call_reversed(script_data, p_method, p_args, p_argcount);
- }
-}
-
NativeScriptInstance::~NativeScriptInstance() {
NativeScriptDesc *script_data = GET_SCRIPT_DESC();