From 818fce31675b784a8b1b9b36c0f90fe1d3500eba Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Mon, 9 Mar 2015 14:09:09 +0100 Subject: [PATCH] Disable lightning arc branching, as this can (and WILL) recurse infinitely. --- qcsrc/client/effects.qc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/effects.qc b/qcsrc/client/effects.qc index 7e0f1c6c5..95623505b 100644 --- a/qcsrc/client/effects.qc +++ b/qcsrc/client/effects.qc @@ -66,8 +66,9 @@ void cl_effects_lightningarc(vector from, vector to,float seglength,float drifts dirnew = normalize(direction * (1 - drift) + randomvec() * drift); pos = pos_l + dirnew * steplength; te_lightning1(world,pos_l,pos); - if(random() < branchfactor) - cl_effects_lightningarc(pos, pos + (dirnew * length * 0.25),seglength,drifts,drifte,min(branchfactor + branchfactor_add,1),branchfactor_add); + // WTF endless recursion if branchfactor is 1.0 (possibly due to adding branchfactor_add). FIXME + // if(random() < branchfactor) + // cl_effects_lightningarc(pos, pos + (dirnew * length * 0.25),seglength,drifts,drifte,min(branchfactor + branchfactor_add,1),branchfactor_add); pos_l = pos; } -- 2.39.2