X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Feffects.qc;h=c0c378fd1a42c4cb5fb697902e8bdca4c743539c;hb=7a85bc59ba3d8d35a90d20b364f53669430eb229;hp=e9bce8f979df565549bf00c2e4955852ffc8cf95;hpb=22a37c4431f80ece25aeff28c18bc67dd183a352;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/effects.qc b/qcsrc/client/effects.qc index e9bce8f97..c0c378fd1 100644 --- a/qcsrc/client/effects.qc +++ b/qcsrc/client/effects.qc @@ -1,9 +1,5 @@ -#if defined(CSQC) - #include "../dpdefs/csprogsdefs.qh" - #include "autocvars.qh" -#elif defined(MENUQC) -#elif defined(SVQC) -#endif +#include "effects.qh" +#include "_all.qh" /* .vector fx_start; @@ -43,7 +39,9 @@ void cl_effects_lightningarc(vector from, vector to,float seglength,float drifts if(length < 1) return; - steps = floor(length / seglength); + // Use at most 16 te_lightning1 segments, as these eat up beam list segments. + // TODO: Change this to R_BeginPolygon code, then we no longer have this limit. + steps = min(16, floor(length / seglength)); if(steps < 1) { te_lightning1(world,from,to); @@ -61,8 +59,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; }