Skip to content

Commit

Permalink
fix to weaponMuzzleVelocity (#6850)
Browse files Browse the repository at this point in the history
* Fix incorrect muzzle velocity displayed on magazine

* Apply suggestions from code review

Co-Authored-By: dedmen <dedmen@users.noreply.github.com>

* Remove garbage file

* Script header updates

* Update addons/ballistics/functions/fnc_statTextStatement_magazineMuzzleVelocity.sqf

Co-Authored-By: dedmen <dedmen@users.noreply.github.com>

* Add Pabst' fix to weaponMuzzleVelocity
  • Loading branch information
PabstMirror authored Mar 8, 2019
1 parent d601436 commit 88de3ee
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ if (_magazine isEqualTo "") then {
private _barrelLengthTable = getArray (_ammoCfg >> "ACE_barrelLengths");

if (_barrelLength != 0 && {count _muzzleVelocityTable > 0} && {count _barrelLengthTable > 0}) then {
private _muzzleVelocity = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, 0] call EFUNC(advanced_ballistics,calculateBarrelLengthVelocityShift);
private _muzzleVelocity = if (["ace_advanced_ballistics"] call EFUNC(common,isModLoaded)) then {
[_barrelLength, _muzzleVelocityTable, _barrelLengthTable, 0] call EFUNC(advanced_ballistics,calculateBarrelLengthVelocityShift);
} else {
getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed")
};

format ["%1 m/s (%2 ft/s)", _muzzleVelocity toFixed 0, (_muzzleVelocity * 3.28084) toFixed 0]
} else {
Expand Down

0 comments on commit 88de3ee

Please sign in to comment.