summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2020-05-19 17:51:53 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2020-05-19 17:51:56 +0200
commit38cd2152e6aec4f633b573034256d75c603398a6 (patch)
tree1b708ea8028e865e28754e8932cb10a19755b2d1
parentea8d9c52884e7702c2b776cb1ddb6be1c1e8f8b5 (diff)
Mono/C#: Remove script load error about not a Godot.Object
Any C# file can be loaded as script and at load time we don't yet know if it's actually meant to be used as a script. As such, such an check can result in a lot of false errors. If the file is really meant to be used as a script, an error would be printed later when attempting to instantiate it any way.
-rw-r--r--modules/mono/csharp_script.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index a5aae5175b..6e3bdf8e41 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -3240,9 +3240,7 @@ Error CSharpScript::reload(bool p_keep_state) {
ERR_FAIL_NULL_V(namespace_, ERR_BUG);
ERR_FAIL_NULL_V(class_name, ERR_BUG);
GDMonoClass *klass = project_assembly->get_class(namespace_->operator String(), class_name->operator String());
- if (klass) {
- bool obj_type = CACHED_CLASS(GodotObject)->is_assignable_from(klass);
- ERR_FAIL_COND_V(!obj_type, ERR_BUG);
+ if (klass && CACHED_CLASS(GodotObject)->is_assignable_from(klass)) {
script_class = klass;
}
} else {