From: Rudolf Polzer Date: Mon, 9 Mar 2015 12:28:55 +0000 (+0100) Subject: Make sure the number of lightning beam segments is bounded. X-Git-Tag: xonotic-v0.8.1~105 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=87930231058825dc3bfe0a757199b55cfafba437;p=xonotic%2Fxonotic-data.pk3dir.git Make sure the number of lightning beam segments is bounded. Otherwise, beam list overflow and infinite loops. --- diff --git a/qcsrc/client/effects.qc b/qcsrc/client/effects.qc index df6884657..7e0f1c6c5 100644 --- a/qcsrc/client/effects.qc +++ b/qcsrc/client/effects.qc @@ -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);