diff options
author | George Marques <george@gmarqu.es> | 2019-11-01 11:45:53 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-01 11:45:53 -0300 |
commit | 5d5df05ee1ef38254cd6fffa3469556ecf986943 (patch) | |
tree | 2cd11e9045d830ac937a12eb7558e440fc00804b /core/script_language.cpp | |
parent | a49c8d4a2bece25d5afd40495d482df514258563 (diff) | |
parent | d8b36a452c83cf99befe3011ccf19bc0310bc387 (diff) |
Merge pull request #32643 from mewin/add_global_class
Check for cyclic inheritance when adding a global script class
Diffstat (limited to 'core/script_language.cpp')
-rw-r--r-- | core/script_language.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/script_language.cpp b/core/script_language.cpp index 7201773ea5..cbe4681eca 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -218,6 +218,7 @@ void ScriptServer::global_classes_clear() { } void ScriptServer::add_global_class(const StringName &p_class, const StringName &p_base, const StringName &p_language, const String &p_path) { + ERR_FAIL_COND_MSG(p_class == p_base || (global_classes.has(p_base) && get_global_class_native_base(p_base) == p_class), "Cyclic inheritance in script class."); GlobalScriptClass g; g.language = p_language; g.path = p_path; |