From ae73332832c3dbea90e4c20dd8096b6d3c58863f Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sun, 12 Aug 2012 19:02:52 +0200 Subject: [PATCH] without -std=gmqcc fields are accessible anywhere where globals are --- parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parser.c b/parser.c index 14fbb2a..8c4d035 100644 --- a/parser.c +++ b/parser.c @@ -601,6 +601,9 @@ static ast_expression* parser_expression(parser_t *parser) { /* variable */ ast_expression *var = parser_find_var(parser, parser_tokval(parser)); + /* in the gmqcc standard, fields are in their own namespace */ + if (!var && opts_standard != COMPILER_GMQCC) + var = parser_find_field(parser, parser_tokval(parser)); if (!var) { parseerror(parser, "unexpected ident: %s", parser_tokval(parser)); goto onerr;