summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2022-09-21 01:34:26 -0500
committerAaron Franke <arnfranke@yahoo.com>2022-09-21 10:48:12 -0500
commitcac7887b11d23f12093e149ae32b08ec4262254e (patch)
treeeb80ee5bc7f8db2098c39587e82c0fdd178c2cf4 /main
parent53d2a9acddf4df5ba7819c154a8a52dc58ddcd1d (diff)
Error if trying to run a self-contained editor in a project folder
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 5fd3786af9..32bdec84b1 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1932,6 +1932,13 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
#ifdef TOOLS_ENABLED
if (editor || project_manager || cmdline_tool) {
EditorPaths::create();
+ if (EditorPaths::get_singleton()->is_self_contained()) {
+ if (ProjectSettings::get_singleton()->get_resource_path() == OS::get_singleton()->get_executable_path().get_base_dir()) {
+ ERR_PRINT("You are trying to run a self-contained editor at the same location as a project. This is not allowed, since editor files will mix with project files.");
+ OS::get_singleton()->set_exit_code(EXIT_FAILURE);
+ return FAILED;
+ }
+ }
}
#endif