]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Calculate impact speed starting from minimum velocity, not actual velocity. Also...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 12:13:48 +0000 (15:13 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 12:13:48 +0000 (15:13 +0300)
effectinfo.txt
qcsrc/server/mutators/sandbox.qc

index 610ae1a23979d0df5498156e83de76f8acd964c8..06e153bf8973a526982e937994b836b323e46b09 100644 (file)
@@ -6411,7 +6411,7 @@ rotate -180 180 -20 20
 // metal impact effect
 // used in qcsrc/server/mutators/sandbox.qc:   pointparticles(particleeffectnum("impact_metal"), self.origin, '0 0 0', 1);
 effect impact_metal
-countabsolute 1
+count 1
 type alphastatic
 tex 0 8
 size 3 6
@@ -6438,7 +6438,7 @@ gravity 1
 // stone impact effect
 // used in qcsrc/server/mutators/sandbox.qc:   pointparticles(particleeffectnum("impact_stone"), self.origin, '0 0 0', 1);
 effect impact_stone
-countabsolute 1
+count 1
 type alphastatic
 tex 0 8
 size 3 6
@@ -6450,7 +6450,7 @@ originjitter 20 20 5
 // debris
 effect impact_stone
 notunderwater
-count 2
+count 1
 type alphastatic
 tex 66 68
 color 0x000000 0x886644
@@ -6465,7 +6465,7 @@ rotate -180 180 -1000 1000
 // wood impact effect
 // used in qcsrc/server/mutators/sandbox.qc:   pointparticles(particleeffectnum("impact_wood"), self.origin, '0 0 0', 1);
 effect impact_wood
-countabsolute 1
+count 1
 type alphastatic
 tex 0 8
 size 3 6
@@ -6491,7 +6491,7 @@ gravity 1
 // flesh impact effect
 // used in qcsrc/server/mutators/sandbox.qc:   pointparticles(particleeffectnum("impact_flesh"), self.origin, '0 0 0', 1);
 effect impact_flesh
-countabsolute 0.5
+count 0.5
 type alphastatic
 tex 0 8
 size 8 12
index 3b07fc8b55c594c5818f12adbd07e0d99f21a7b4..b8f30c42c8722c12d66477d191f7e4f50a9a8113 100644 (file)
@@ -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)