Skip to content

Commit

Permalink
Fix '!valid' error spam on C# script instance create
Browse files Browse the repository at this point in the history
  • Loading branch information
neikeq committed Jul 25, 2018
1 parent 5aefe5d commit 8edf85b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/mono/csharp_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1963,8 +1963,6 @@ Variant CSharpScript::_new(const Variant **p_args, int p_argcount, Variant::Call

ScriptInstance *CSharpScript::instance_create(Object *p_this) {

ERR_FAIL_COND_V(!valid, NULL);

if (!tool && !ScriptServer::is_scripting_enabled()) {
#ifdef TOOLS_ENABLED
PlaceHolderScriptInstance *si = memnew(PlaceHolderScriptInstance(CSharpLanguage::get_singleton(), Ref<Script>(this), p_this));
Expand All @@ -1981,13 +1979,15 @@ ScriptInstance *CSharpScript::instance_create(Object *p_this) {
// 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);
} else {
// 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);
}

// 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);
}

ERR_FAIL_COND_V(!valid, NULL);

if (native) {
String native_name = native->get_name();
if (!ClassDB::is_parent_class(p_this->get_class_name(), native_name)) {
Expand Down

2 comments on commit 8edf85b

@neikeq
Copy link
Contributor Author

@neikeq neikeq commented on 8edf85b Jul 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, this introduced a regression. Trying to fix it...

@neikeq
Copy link
Contributor Author

@neikeq neikeq commented on 8edf85b Jul 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, this introduced a regression. Trying to fix it...

False alarm.

Please sign in to comment.