]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
entity setter array subscript needs to get a correct field type
authorWolfgang Bumiller <blub@speed.at>
Sat, 12 Jan 2013 14:49:31 +0000 (15:49 +0100)
committerWolfgang Bumiller <blub@speed.at>
Sat, 12 Jan 2013 14:49:31 +0000 (15:49 +0100)
parser.c

index 32e9427bc49be1bb6c14e261fa8fe30a7ca6cc74..4459d7b1bdc336ed4c01c7c6580527f77d302978 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -4191,6 +4191,9 @@ static ast_expression *array_field_setter_node(
         if (!subscript)
             return NULL;
 
+        subscript->expression.next = ast_type_copy(ast_ctx(subscript), (ast_expression*)subscript);
+        subscript->expression.vtype = TYPE_FIELD;
+
         entfield = ast_entfield_new_force(ctx,
                                           (ast_expression*)entity,
                                           (ast_expression*)subscript,
@@ -5011,7 +5014,7 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield
                     goto cleanup;
                     */
                 }
-                if (opts.standard == COMPILER_QCC &&
+                if ((opts.standard == COMPILER_QCC || opts.standard == COMPILER_FTEQCC) &&
                     (old = parser_find_global(parser, var->name)))
                 {
                     parseerror(parser, "cannot declare a field and a global of the same name with -std=qcc");