summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-10-16 10:19:16 +0200
committerGitHub <noreply@github.com>2017-10-16 10:19:16 +0200
commit8de1dc7e9a1d137d9904122e775c270b03f4e049 (patch)
tree6215953b9a904a4c6f81de52796e6a75823ee363
parentc0293aca5967c49870b96b106425180e22a58c86 (diff)
parent967335b969d1cd11a556d012cd72f29d83186ad2 (diff)
Merge pull request #12138 from neikeq/i
Avoid adding built-in script path to csproj
-rw-r--r--modules/mono/csharp_script.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 50a78e379a..69895e58e2 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -1421,12 +1421,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