summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-01-03 20:40:33 +0100
committerGitHub <noreply@github.com>2022-01-03 20:40:33 +0100
commit98b3ba1842a47a34097499a9eee6aa31083a99df (patch)
tree33efc4bb525ed4452c4924efc459bacbf4c5d68b /modules/gdscript/gdscript.cpp
parent20563b081bcbfe853622a139422751dba6a75714 (diff)
parent9d5b80705912d85c3c7301ac0ea0afbf9372a660 (diff)
downloadredot-engine-98b3ba1842a47a34097499a9eee6aa31083a99df.tar.gz
Merge pull request #53957 from fabriceci/new-template-workflow
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r--modules/gdscript/gdscript.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 4822e411ce..02c1bfb40c 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -49,6 +49,10 @@
#include "tests/gdscript_test_runner.h"
#endif
+#ifdef TOOLS_ENABLED
+#include "editor/editor_settings.h"
+#endif
+
///////////////////////////
GDScriptNativeClass::GDScriptNativeClass(const StringName &p_name) {
@@ -817,10 +821,16 @@ Error GDScript::reload(bool p_keep_state) {
basedir = basedir.get_base_dir();
}
- if (source.find("%BASE%") != -1) {
- //loading a template, don't parse
+// Loading a template, don't parse.
+#ifdef TOOLS_ENABLED
+ if (basedir.begins_with(EditorSettings::get_singleton()->get_project_script_templates_dir())) {
return OK;
}
+#else
+ if (source.find("_BASE_") != -1) {
+ return OK;
+ }
+#endif
{
String source_path = path;