瀏覽代碼

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'.
Ignacio Etcheverry 5 年之前
父節點
當前提交
4be87c6016
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      core/class_db.cpp

+ 7 - 0
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);
 			}