-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ballistics - Improve arsenal muzzle velocity stat #10594
Conversation
private _muzzleVelocity = getNumber (_configMagazine >> "initSpeed"); | ||
|
||
private _abAdjustText = ""; | ||
private _useAB = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && {EGVAR(advanced_ballistics,barrelLengthInfluenceEnabled)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boolean checks are too fast for lazy eval. If anything, the order should be flipped:
private _useAB = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && {EGVAR(advanced_ballistics,barrelLengthInfluenceEnabled)}; | |
private _useAB = EGVAR(advanced_ballistics,barrelLengthInfluenceEnabled) && {missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need the lazy eval. Second variable might be nil (but shouldn't be nil if first variable is true). This was done on purpose.
} params ["_weapon", "_magazine"]; | ||
private _magClass = configName _configMagazine; | ||
private _weapons = [primaryWeapon EGVAR(arsenal,center), handgunWeapon EGVAR(arsenal,center)]; | ||
private _weaponIndex = _weapons findIf {_x canAdd [_magClass, _x]}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't know about weapon canAdd item
syntax, neat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New-ish. Was added around the same time as compatibleItems/Magazines weapon
When merged this pull request will:
IMPORTANT
Component - Add|Fix|Improve|Change|Make|Remove {changes}
.