index 5424b64b8e8104cee9902fb59f15f89c117885de..de5abb1fda2630afc7103b57d9ddda2fb083b87a 100644 (file)
float avg_dist, n;
entity p;

+
avg_origin = e.origin;
avg_velocity = e.velocity;
n = 1;
avg_origin *= (1.0 / n);
avg_velocity *= (1.0 / n);

+       if(n < 2)
+               return avg_origin; // nothing to do
+
// yes, mathematically we can do this in ONE step, but beware of 32bit floats...
avg_dist = pow(vlen(e.origin - avg_origin), 2);
for(p = e; (p = p.queuenext) != e; )
avg_dist *= (1.0 / n);
avg_dist = sqrt(avg_dist);

if(avg_dist == 0)
return avg_origin; // no change needed

return targ_origin;
}

+{
+       // is there at least 2 projectiles very close?
+       entity e, p;
+       float n;
+       n = 0;
+       if(e)
+       {
+               if(vlen(e.origin - self.origin) < vlen(e.velocity) * frametime)
+                       ++n;
+               for(p = e; (p = p.queuenext) != e; )
+               {
+                       if(vlen(p.origin - self.origin) < vlen(p.velocity) * frametime)
+                               ++n;
+               }
+               if(n >= 2)
+               {
+                       // they seem to touch...
+                       // TODO make a specific particle effect for this
+               }
+       }
+       remove(self);
+}
+
// NO bounce protection, as bounces are limited!
{
@@ -434,14 +464,23 @@ float w_crylink(float req)
// fired and released now!
{
+                                       vector pos;
{
}
else
{
}
+