mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-21 02:10:53 +00:00
fixing ast_binstore_codegen's lvalue flag setting, now += on entfields works correctly
This commit is contained in:
parent
a574da7df8
commit
baf6d3ead4
2 changed files with 6 additions and 2 deletions
2
ast.c
2
ast.c
|
@ -1013,7 +1013,7 @@ bool ast_binstore_codegen(ast_binstore *self, ast_function *func, bool lvalue, i
|
|||
/* for a binstore we need both an lvalue and an rvalue for the left side */
|
||||
/* rvalue of destination! */
|
||||
cgen = self->dest->expression.codegen;
|
||||
if (!(*cgen)((ast_expression*)(self->dest), func, true, &leftr))
|
||||
if (!(*cgen)((ast_expression*)(self->dest), func, false, &leftr))
|
||||
return false;
|
||||
|
||||
/* source as rvalue only */
|
||||
|
|
|
@ -51,8 +51,12 @@ void() main = {
|
|||
float b;
|
||||
a = 5;
|
||||
print3("a = ", ftos(a), "\n");
|
||||
b = (a += 7);
|
||||
b = a += 7;
|
||||
print("adding\n");
|
||||
print3("a = ", ftos(a), "\n");
|
||||
print3("b = ", ftos(a), "\n");
|
||||
|
||||
print3("memb = ", ftos(pawn.memb), "\n");
|
||||
pawn.memb += 1;
|
||||
print3("memb = ", ftos(pawn.memb), "\n");
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue