mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
97a74eb677
These kinds of expressions currently cannot be handled without pionter support in the qcvm without scanning the ast from within ast_member::codegen for an assignments as seen in the added test case. This change makes code like that return a pointer type which will cause an error that we did not get a vector or field back. With pointer support this pointer could actually be used instead. So at least it shouldn't silently produce broken code anymore. Signed-off-by: Wolfgang Bumiller <wry.git@bumiller.com>
17 lines
245 B
C++
17 lines
245 B
C++
.vector v1;
|
|
|
|
float set(entity e, float v) {
|
|
e.v1.y = v;
|
|
return e.v1.y;
|
|
}
|
|
|
|
void main() {
|
|
entity e = spawn();
|
|
e.v1 = '1 2 3';
|
|
print(ftos(set(e, 42)), " => ");
|
|
print(vtos(e.v1), "\n");
|
|
|
|
#ifdef BROKEN_ACCESS
|
|
(e.v1 = '0 0 0').x += 1;
|
|
#endif
|
|
}
|