+void vehilces_impact(float _minspeed, float _speedfac, float _maxpain)
+{
+ if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
+ return;
+
+ if(self.play_time < time)
+ {
+ float wc = vlen(self.velocity - self.oldvelocity);
+ //dprint("oldvel: ", vtos(self.oldvelocity), "\n");
+ //dprint("vel: ", vtos(self.velocity), "\n");
+ if(_minspeed < wc)
+ {
+ float take = take = min(_speedfac * wc, _maxpain);
+ Damage (self, world, world, take, DEATH_FALL, self.origin, '0 0 0');
+ self.play_time = time + 0.25;
+
+ //dprint("wc: ", ftos(wc), "\n");
+ //dprint("take: ", ftos(take), "\n");
+ }
+ }
+}
+
+.void() vehicle_impact;