+#include "effects.qh"
+#include "_all.qh"
+
/*
.vector fx_start;
.vector fx_end;
.string fx_texture;
.float fx_lifetime;
-void SUB_Remove()
-{ remove(self); }
-
void b_draw()
{
//Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, 0, time * 3, '1 1 1', 0.7, DRAWFLAG_ADDITIVE, view_origin);
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);
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;
}
{
vector from, to;
- from_x = ReadCoord(); from_y = ReadCoord(); from_z = ReadCoord();
- to_x = ReadCoord(); to_y = ReadCoord(); to_z = ReadCoord();
+ from.x = ReadCoord(); from.y = ReadCoord(); from.z = ReadCoord();
+ to.x = ReadCoord(); to.y = ReadCoord(); to.z = ReadCoord();
if(autocvar_cl_effects_lightningarc_simple)
{