From: Martin Taibr Date: Mon, 15 Aug 2016 23:52:12 +0000 (+0200) Subject: don't go below 0 X-Git-Tag: xonotic-v0.8.2~709^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b1c682ba0a6ef462f9484cf3296f737cfda2ae7c;p=xonotic%2Fxonotic-data.pk3dir.git don't go below 0 --- diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index a12ea2d9e..f773180fe 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -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))