diff options
author | Ignacio Etcheverry <neikeq@users.noreply.github.com> | 2018-05-24 20:38:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-24 20:38:18 +0200 |
commit | 64c903580ec5798e480a7c5215117bdcc933e93e (patch) | |
tree | 0e9a154eea5187f3195a575a2be2c8c3899fa5a7 /modules/mono | |
parent | aee8d262528497298a50ff2b25eefd8dce18c033 (diff) | |
parent | c8945fe7d81c6168e300375d2e6d2a9b01612496 (diff) |
Merge pull request #19149 from neikeq/x
Mono: Improve 'script class not found' error
Diffstat (limited to 'modules/mono')
-rw-r--r-- | modules/mono/csharp_script.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 039c33361f..24292b77ed 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1954,11 +1954,6 @@ Variant CSharpScript::_new(const Variant **p_args, int p_argcount, Variant::Call ScriptInstance *CSharpScript::instance_create(Object *p_this) { - if (!script_class) { - ERR_EXPLAIN("Cannot find class " + name + " for script " + get_path()); - ERR_FAIL_V(NULL); - } - ERR_FAIL_COND_V(!valid, NULL); if (!tool && !ScriptServer::is_scripting_enabled()) { @@ -1972,6 +1967,18 @@ ScriptInstance *CSharpScript::instance_create(Object *p_this) { return NULL; #endif } + + if (!script_class) { + if (GDMono::get_singleton()->get_project_assembly() == NULL) { + // The project assembly is not loaded + ERR_EXPLAIN("Cannot instance script because the project assembly is not loaded. Script: " + get_path()); + ERR_FAIL_V(NULL); + } + + // The project assembly is loaded, but the class could not found + ERR_EXPLAIN("Cannot instance script because the class '" + name + "' could not be found. Script: " + get_path()); + ERR_FAIL_V(NULL); + } update_signals(); |