]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parser.c
When storing to a vector member as part of an entity field we must use STOREP
[xonotic/gmqcc.git] / parser.c
index e1779da37667f157085c3e40322378c01fd657fd..4a09583593a97c5cebe19090d9f5368e7ed89e7e 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -953,6 +953,9 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
                 }
             }
             (void)check_write_to(ctx, exprs[0]);
+            /* When we're a vector of part of an entity field we use STOREP */
+            if (ast_istype(exprs[0], ast_member) && ast_istype(((ast_member*)exprs[0])->owner, ast_entfield))
+                assignop = INSTR_STOREP_F;
             out = (ast_expression*)ast_store_new(ctx, assignop, exprs[0], exprs[1]);
             break;
         case opid3('+','+','P'):