break;
float dist_taken = max(autocvar_g_ballistics_mindistance, vlen(trace_endpos - start));
- solid_penetration_left -= (dist_taken / maxdist);
- solid_penetration_left = max(solid_penetration_left, 0);
+ // 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;
// Only show effect when going through a player (invisible otherwise)
if (hit && (hit.solid != SOLID_BSP))