]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Allow assigning nil to a field
authorWolfgang Bumiller <blub@speed.at>
Mon, 31 Dec 2012 10:23:49 +0000 (11:23 +0100)
committerWolfgang Bumiller <blub@speed.at>
Mon, 31 Dec 2012 10:23:49 +0000 (11:23 +0100)
parser.c

index e2eabc1e680cbfb49e437700335239f68ff6bb8e..0dddd78d67437b799bce43174129e0417da88dc8 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1042,7 +1042,7 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
                 else
                     assignop = type_storep_instr[exprs[0]->expression.vtype];
                 if (assignop == AINSTR_END ||
-                    !ast_compare_type(field->expression.next, exprs[1]))
+                    (exprs[1]->expression.vtype != TYPE_NIL && !ast_compare_type(field->expression.next, exprs[1])))
                 {
                     ast_type_to_string(field->expression.next, ty1, sizeof(ty1));
                     ast_type_to_string(exprs[1], ty2, sizeof(ty2));