]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/effects.qc
Make sure the number of lightning beam segments is bounded.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / effects.qc
index df688465739685158b99a52f0346115d2012818b..7e0f1c6c5feaf70f3d1c0b66618c7ec8c7a4a255 100644 (file)
@@ -46,7 +46,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);