summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-11-18 18:39:51 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-11-18 18:39:51 -0300
commit4dc06dfdcde7ea4b84eb47e06b81c24a1d61ebd2 (patch)
tree3eaf046e026fbad3badb4455c2d9772cba1faa62
parent0bbe1e16572b6ee0ae73f8412b8fa05421ceb1ef (diff)
parentbbc42a159c0e2ec04e317bb0766472e4d35e2819 (diff)
Merge pull request #2776 from eska014/extend-object
GDScript: Allow extending directly from Object
-rw-r--r--modules/gdscript/gd_parser.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 313fb57d0e..202ab76da0 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -1940,9 +1940,15 @@ void GDParser::_parse_extends(ClassNode *p_class) {
p_class->extends_used=true;
- //see if inheritance happens from a file
tokenizer->advance();
+ if (tokenizer->get_token()==GDTokenizer::TK_BUILT_IN_TYPE && tokenizer->get_token_type()==Variant::OBJECT) {
+ p_class->extends_class.push_back(Variant::get_type_name(Variant::OBJECT));
+ tokenizer->advance();
+ return;
+ }
+
+ // see if inheritance happens from a file
if (tokenizer->get_token()==GDTokenizer::TK_CONSTANT) {
Variant constant = tokenizer->get_token_constant();