]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
even in non-qcc mode we need to search the variables for fields because of field...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 14:21:09 +0000 (16:21 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 14:21:09 +0000 (16:21 +0200)
parser.c

index 74074392d6ee5263485a7f77d5b3b0db24eb3806..62953ce46a49d56f7b7db0fece227bf3dd09cf47 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -965,8 +965,12 @@ static ast_expression* parser_expression_leave(parser_t *parser, bool stopatcomm
             /* variable */
             if (opts_standard == COMPILER_GMQCC)
             {
-                if (parser->memberof == TYPE_ENTITY)
-                    var = parser_find_field(parser, parser_tokval(parser));
+                if (parser->memberof == TYPE_ENTITY) {
+                    /* still get vars first since there could be a fieldpointer */
+                    var = parser_find_var(parser, parser_tokval(parser));
+                    if (!var)
+                        var = parser_find_field(parser, parser_tokval(parser));
+                }
                 else if (parser->memberof == TYPE_VECTOR)
                 {
                     parseerror(parser, "TODO: implement effective vector member access");