mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-26 14:55:30 +03:00
Fixed Vector unary minus operator modifying the instance itself
This commit is contained in:
parent
b718f19d45
commit
491b258f70
@ -464,7 +464,12 @@ namespace SQVector
|
||||
return sq_throwerror(vm, "Expected (Vector)");
|
||||
}
|
||||
|
||||
v1->Negate();
|
||||
sq_getclass(vm, 1);
|
||||
sq_createinstance(vm, -1);
|
||||
SQUserPointer p;
|
||||
sq_getinstanceup(vm, -1, &p, 0);
|
||||
new(p) Vector(-v1->x, -v1->y, -v1->z);
|
||||
sq_remove(vm, -2);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user