diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-19 20:48:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-19 20:48:59 +0200 |
commit | cba1f492cc300bf5686f8ccd7f743bc37635fa54 (patch) | |
tree | 15dabebf784be02d8cda9bace0fff9aa130e973f | |
parent | 0942ddfa2b803e1a881eaf5cb181adc1e5077dc2 (diff) | |
parent | 38cd2152e6aec4f633b573034256d75c603398a6 (diff) |
Merge pull request #38863 from neikeq/csharp-no-false-error-objtype-reload
Mono/C#: Remove script load error about not a Godot.Object
-rw-r--r-- | modules/mono/csharp_script.cpp | 4 |
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 { |