From: Dale Weiler Date: Wed, 31 Jul 2013 17:24:32 +0000 (+0000) Subject: Fixes X-Git-Tag: v0.3.0~43 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3fa74da2b5fd1c9eb336822ed500795f6cc66fd3;p=xonotic%2Fgmqcc.git Fixes --- diff --git a/fold.c b/fold.c index 5352b78..ad264e7 100644 --- a/fold.c +++ b/fold.c @@ -383,13 +383,17 @@ static GMQCC_INLINE ast_expression *fold_op_sub(fold_t *fold, ast_value *a, ast_ static GMQCC_INLINE ast_expression *fold_op_mul(fold_t *fold, ast_value *a, ast_value *b) { if (isfloat(a)) { - if (isfloat(b) && fold_can_2(a, b)) - return fold_constgen_vector(fold, vec3_mulvf(fold_immvalue_vector(b), fold_immvalue_float(a))); - else if (fold_can_2(a, b)) - return fold_constgen_float(fold, fold_immvalue_float(a) * fold_immvalue_float(b)); + if (isfloat(b)) { + if (fold_can_2(a, b)) + return fold_constgen_vector(fold, vec3_mulvf(fold_immvalue_vector(b), fold_immvalue_float(a))); + } else { + if (fold_can_2(a, b)) + return fold_constgen_float(fold, fold_immvalue_float(a) * fold_immvalue_float(b)); + } } else if (isvector(a)) { - if (isfloat(b) && fold_can_2(a, b)) { - return fold_constgen_vector(fold, vec3_mulvf(fold_immvalue_vector(a), fold_immvalue_float(b))); + if (isfloat(b)) { + if (fold_can_2(a, b)) + return fold_constgen_vector(fold, vec3_mulvf(fold_immvalue_vector(a), fold_immvalue_float(b))); } else { if (fold_can_2(a, b)) { return fold_constgen_float(fold, vec3_mulvv(fold_immvalue_vector(a), fold_immvalue_vector(b)));