X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fsandbox.qc;h=b8f30c42c8722c12d66477d191f7e4f50a9a8113;hb=b43cb7e040a50b242071bd242c4597b6f40c264e;hp=3b07fc8b55c594c5818f12adbd07e0d99f21a7b4;hpb=70a88fcb0cbe4a92c2e80f0b262adb820d4defbe;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 3b07fc8b5..b8f30c42c 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -19,11 +19,12 @@ void sandbox_Object_Touch() // make particle count and sound volume depend on impact speed float intensity; intensity = vlen(self.velocity) + vlen(other.velocity); - if(intensity) // check this first to avoid divisions by 0 + if(intensity) // avoid divisions by 0 intensity /= 2; // average the two velocities if not(intensity >= autocvar_g_sandbox_object_material_velocity_min) return; // impact not strong enough to do anything // now offset intensity and apply it to the effects + intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity intensity = bound(0, intensity * autocvar_g_sandbox_object_material_velocity_factor, 1); switch(self.material)