aboutsummaryrefslogtreecommitdiff
path: root/modules/mono/csharp_script.cpp
diff options
context:
space:
mode:
authorIgnacio Etcheverry2018-05-24 20:16:23 +0200
committerHein-Pieter van Braam2018-06-01 18:04:12 +0200
commit9945da3efc3a616d051b3cd67cc06a49f99786f7 (patch)
tree8b2772b94ebf32ffbbaa3d2b80de1a0c3cb008dc /modules/mono/csharp_script.cpp
parentd1e5677fe693aaab2b326d87e83d05115cc431cf (diff)
downloadgodot-9945da3efc3a616d051b3cd67cc06a49f99786f7.tar.gz
godot-9945da3efc3a616d051b3cd67cc06a49f99786f7.tar.zst
godot-9945da3efc3a616d051b3cd67cc06a49f99786f7.zip
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r--modules/mono/csharp_script.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index adc5f16f9..5cedc89ab 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();