]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
don't go below 0 351/head
authorMartin Taibr <taibr.martin@gmail.com>
Mon, 15 Aug 2016 23:52:12 +0000 (01:52 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Mon, 15 Aug 2016 23:52:12 +0000 (01:52 +0200)
qcsrc/server/weapons/tracing.qc

index a12ea2d9e181cfac81a2841b90781fc91a34b6f7..f773180fea091f1621a03b1886aba93a3ed9ee69 100644 (file)
@@ -478,6 +478,7 @@ void fireBullet(entity this, vector start, vector dir, float spread, float max_s
                // fraction_used_of_what_is_left = dist_taken / maxdist
                // solid_penetration_left = solid_penetration_left - solid_penetration_left * fraction_used_of_what_is_left
                solid_penetration_left *= 1 - dist_taken / maxdist;
+               solid_penetration_left = max(solid_penetration_left, 0);
 
                // Only show effect when going through a player (invisible otherwise)
                if (hit && (hit.solid != SOLID_BSP))