From ed772ebeb7ed5b0e46b292b8b85ce3fc5b34382f Mon Sep 17 00:00:00 2001 From: ulteq Date: Sat, 25 Nov 2017 17:45:09 +0100 Subject: [PATCH] Advanced Ballistics - Typo: 'log' -> 'ln' (#5818) We need to use the natural logarithm here. --- addons/advanced_ballistics/functions/fnc_handleFired.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index 592094cc76..950295e6ef 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -70,7 +70,7 @@ if (GVAR(muzzleVelocityVariationEnabled)) then { // Generate seed from publicly known values (via Cantor pairing function) private _seed = 0.5 * (_time + _ammoCount) * (_time + _ammoCount + 1) + _ammoCount; // Generate normally distributed random number (via Box–Muller transform) - private _z = sqrt(-2.0 * log(0.00000001 max (-_seed random 1))) * cos(_seed random 360); + private _z = sqrt(-2.0 * ln(0.00000001 max (-_seed random 1))) * cos(_seed random 360); _muzzleVelocity = _muzzleVelocity * (_z * _muzzleVelocityVariationSD + 1); };