mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Check for the vector being a constant before trying to get its value.
This commit is contained in:
parent
c069bafad8
commit
041c5d53b8
1 changed files with 2 additions and 1 deletions
|
@ -342,7 +342,8 @@ do_op_vector (int op, expr_t *e, expr_t *e1, expr_t *e2)
|
|||
return e2;
|
||||
if (op == '+' && is_constant (e2) && VectorIsZero (expr_vector (e2)))
|
||||
return e1;
|
||||
if (op == '-' && is_constant (e1) && VectorIsZero (expr_vector (e1))) {
|
||||
if (op == '-' && is_constant (e1) && VectorIsZero (expr_vector (e1))
|
||||
&& is_constant (e2)) {
|
||||
vec3_t v;
|
||||
VectorNegate (expr_vector (e2), v);
|
||||
e = new_vector_expr (v);
|
||||
|
|
Loading…
Reference in a new issue