diff options
| author | Ignacio Etcheverry | 2017-10-16 04:26:13 +0200 |
|---|---|---|
| committer | Ignacio Etcheverry | 2017-10-16 04:26:13 +0200 |
| commit | 967335b969d1cd11a556d012cd72f29d83186ad2 (patch) | |
| tree | d73fe85d81a03894ea4240ae6a7687ab8db2ccda /modules/mono/csharp_script.cpp | |
| parent | 1a9efb417a20d2753a942cc5d4d2d46ce8cde7fb (diff) | |
| download | godot-967335b969d1cd11a556d012cd72f29d83186ad2.tar.gz godot-967335b969d1cd11a556d012cd72f29d83186ad2.tar.zst godot-967335b969d1cd11a556d012cd72f29d83186ad2.zip | |
Diffstat (limited to 'modules/mono/csharp_script.cpp')
| -rw-r--r-- | modules/mono/csharp_script.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 7f92a672d..9ac1f4aea 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1352,12 +1352,15 @@ bool CSharpScript::can_instance() const { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint()) { - if (_create_project_solution_if_needed()) { - CSharpProject::add_item(GodotSharpDirs::get_project_csproj_path(), - "Compile", - ProjectSettings::get_singleton()->globalize_path(get_path())); - } else { - ERR_PRINTS("Cannot add " + get_path() + " to the C# project because it could not be created."); + + if (get_path().find("::") == -1) { // Ignore if built-in script. Can happen if the file is deleted... + if (_create_project_solution_if_needed()) { + CSharpProject::add_item(GodotSharpDirs::get_project_csproj_path(), + "Compile", + ProjectSettings::get_singleton()->globalize_path(get_path())); + } else { + ERR_PRINTS("Cannot add " + get_path() + " to the C# project because it could not be created."); + } } } #endif |
