Merge pull request #38863 from neikeq/csharp-no-false-error-objtype-reload

Mono/C#: Remove script load error about not a Godot.Object
This commit is contained in:
Rémi Verschelde 2020-05-19 20:48:59 +02:00 committed by GitHub
commit cba1f492cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -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 {