summaryrefslogtreecommitdiffstats
path: root/modules/mono/csharp_script.cpp
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2020-05-10 21:49:15 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2020-05-10 21:49:15 +0200
commit840255a04b2248dbe537e507c1ceb7ac90713270 (patch)
tree4430f5720d7feef0fbf40d24d83e7fe7d2351feb /modules/mono/csharp_script.cpp
parent6a0473bcc23c096ef9ee929632a209761c2668f6 (diff)
downloadredot-engine-840255a04b2248dbe537e507c1ceb7ac90713270.tar.gz
Implement CSharpScript::inherits_script
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r--modules/mono/csharp_script.cpp13
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 {