summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2020-01-07 00:08:46 +0100
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2020-01-07 00:08:49 +0100
commit4be87c6016a5893cbde897924e540df4c988cee5 (patch)
treecbbb44f9d4c21840a22855be0243410323b2b22f
parent399e53e8c328f47bc116b743cd19c66c83e1122b (diff)
downloadredot-engine-4be87c6016a5893cbde897924e540df4c988cee5.tar.gz
ClassDB: Exclude method binds starting with '_' from API hash
These methods are not meant to be part of the scripting API. These are not the same as virtual methods starting with '_', e.g.: '_process'.
-rw-r--r--core/class_db.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp
index 3cd04c6573..65f0c6008c 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -389,6 +389,13 @@ uint64_t ClassDB::get_api_hash(APIType p_api) {
while ((k = t->method_map.next(k))) {
+ String name = k->operator String();
+
+ ERR_CONTINUE(name.empty());
+
+ if (name[0] == '_')
+ continue; // Ignore non-virtual methods that start with an underscore
+
snames.push_back(*k);
}