summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_parser.cpp
diff options
context:
space:
mode:
authorlupoDharkael <izhe@hotmail.es>2019-04-17 17:06:21 +0200
committerlupoDharkael <izhe@hotmail.es>2019-04-17 17:06:21 +0200
commit2ad302cec4dc41db8cbb657b2e1946275967f1c4 (patch)
tree78fcce3801c749425775de0d8120b5aa8f153960 /modules/gdscript/gdscript_parser.cpp
parent145a45fd3f15b3d7929e5e702b8828186fed34fb (diff)
downloadredot-engine-2ad302cec4dc41db8cbb657b2e1946275967f1c4.tar.gz
Don't allow class_name in built-in scripts
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r--modules/gdscript/gdscript_parser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 80af094c2c..649f4b7668 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -3500,7 +3500,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
_set_error("'class_name' is only valid for the main class namespace.");
return;
}
- if (self_path.empty()) {
+ if (self_path.begins_with("res://") && self_path.find("::") != -1) {
_set_error("'class_name' not allowed in built-in scripts.");
return;
}