diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2020-05-10 21:49:15 +0200 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2020-05-10 21:49:15 +0200 |
commit | 840255a04b2248dbe537e507c1ceb7ac90713270 (patch) | |
tree | 4430f5720d7feef0fbf40d24d83e7fe7d2351feb /modules/mono/csharp_script.cpp | |
parent | 6a0473bcc23c096ef9ee929632a209761c2668f6 (diff) | |
download | redot-engine-840255a04b2248dbe537e507c1ceb7ac90713270.tar.gz |
Implement CSharpScript::inherits_script
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r-- | modules/mono/csharp_script.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 6c1c8b87ef..277524913c 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -3542,10 +3542,15 @@ bool CSharpScript::inherits_script(const Ref<Script> &p_script) const { return false; } -#ifndef _MSC_VER -#warning TODO: Implement CSharpScript::inherits_script and other relevant changes after GH-38063. -#endif - return false; + if (script_class == nullptr || cs->script_class == nullptr) { + return false; + } + + if (script_class == cs->script_class) { + return true; + } + + return cs->script_class->is_assignable_from(script_class); } Ref<Script> CSharpScript::get_base_script() const { |