From 42514bfd8019e39586eeefddd63c4135fc6e7ebd Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 10 Apr 2019 18:05:34 -0300 Subject: [PATCH] GDScript: Don't allow built-in scripts to use class_name (cherry picked from commit e56f5d5c910f076fd93af71ada7550f441207f45) --- modules/gdscript/gdscript_parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 6ed7f097443..25a41748cc9 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3494,6 +3494,10 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { _set_error("'class_name' is only valid for the main class namespace."); return; } + if (self_path.empty()) { + _set_error("'class_name' not allowed in built-in scripts."); + return; + } if (tokenizer->get_token(1) != GDScriptTokenizer::TK_IDENTIFIER) { _set_error("'class_name' syntax: 'class_name '");